title: SpringXD: auto-startup=false not working on Kafka message-driven-channel-adapter
body: <p>I'm using <code>SpringXD</code>, and I have the following config:</p>
  
  <ul>
  <li>spring-integration-kafka 2.1.0.RELEASE</li>
  <li>kafka-clients 0.10.0.1</li>
  <li>Kafka 0.10.x.x</li>
  <li>spring-xd-1.3.1.RELEASE</li>
  </ul>
  
  <p>I have the following config in my xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
      xmlns:int-kafka="http://www.springframework.org/schema/integration/kafka"
      xmlns:task="http://www.springframework.org/schema/task"
      xsi:schemaLocation="http://www.springframework.org/schema/integration/kafka http://www.springframework.org/schema/integration/kafka/spring-integration-kafka.xsd
          http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"&gt;
  
  
      &lt;int:channel id="input" /&gt;
      &lt;int:channel id="output" /&gt;
  
      &lt;int:control-bus input-channel="input" /&gt;
  
      &lt;int-kafka:message-driven-channel-adapter
          id="kafka-inbound-channel-adapter-testing" listener-container="container1"
          auto-startup="false" phase="100" send-timeout="5000"
          channel="output" mode="record"
          message-converter="messageConverter" /&gt;
  
      &lt;bean id="messageConverter" class="org.springframework.kafka.support.converter.MessagingMessageConverter" /&gt;
  
      &lt;!--Consumer --&gt;
      &lt;bean id="container1"
          class="org.springframework.kafka.listener.KafkaMessageListenerContainer"&gt;
          &lt;constructor-arg&gt;
              &lt;bean class="org.springframework.kafka.core.DefaultKafkaConsumerFactory"&gt;
                  &lt;constructor-arg&gt;
                      &lt;map&gt;
                          &lt;entry key="bootstrap.servers" value="localhost:9092" /&gt;
                          &lt;entry key="enable.auto.commit" value="false" /&gt;
                          &lt;entry key="auto.commit.interval.ms" value="100" /&gt;
                          &lt;entry key="session.timeout.ms" value="15000" /&gt;
                          &lt;entry key="max.poll.records" value="3" /&gt;
                          &lt;entry key="group.id" value="bridge-stream-testing" /&gt;
                          &lt;entry key="key.deserializer" value="org.apache.kafka.common.serialization.IntegerDeserializer" /&gt;
                          &lt;entry key="value.deserializer" value="org.apache.kafka.common.serialization.StringDeserializer" /&gt;
                      &lt;/map&gt;
                  &lt;/constructor-arg&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
  
          &lt;constructor-arg&gt;
              &lt;bean class="org.springframework.kafka.listener.config.ContainerProperties"&gt;
                  &lt;constructor-arg name="topics" value="testing-topic" /&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>This is the Java class that I'm using to start/stop the channel:</p>
  
  <pre><code>package com.kafka.source.logic;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.ImportResource;
  import org.springframework.messaging.MessageChannel;
  import org.springframework.messaging.support.GenericMessage;
  import org.springframework.scheduling.annotation.EnableScheduling;
  import org.springframework.scheduling.annotation.Scheduled;
  
  @Configuration
  @EnableScheduling
  @ImportResource("classpath:/config/kafka-source-context.xml")
  public class KafkaSourceRetry {
  
      @Autowired
      MessageChannel input;
  
      @Scheduled(cron="*/50 * * * * *")
      void startAdapter(){
          //CODE COMMENTED OUT TO MAKE SURE THE ADAPTER IS NOT BEING STARTED
          //EVEN IF I UNCOMMENT THE CODE, THE 50 secs defined related to the cron are not respected.
          //That is, if I send a message to the topic, it is inmediately consumed
          //input.send(new GenericMessage&lt;String&gt;("@kafka-inbound-channel-adapter-testing.start()"));
      }
  }
  </code></pre>
  
  <p>Then I created a basic stream to check if some messages that I'm sending to the topic are coming through</p>
  
  <pre><code>stream create --name bridgeStream --definition "kafkaSourceLatestApi_v2|bridge|file" --deploy
  </code></pre>
  
  <p>I checked the file that was created, and it contained all the messages that I sent to the Kafka topic:</p>
  
  <blockquote>
    <p>hola_que_tal que_bonito  bridgeStream.out (END)</p>
  </blockquote>
  
  <p>Also in the logs I found this:</p>
  
  <blockquote>
    <p>2017-04-10T22:37:06-0300 1.3.1.RELEASE INFO
    DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor -
    Starting beans in phase 0 2017-04-10T22:37:06-0300 1.3.1.RELEASE DEBUG
    DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor -
    Starting bean 'container1' of type [class
    org.springframework.kafka.listener.KafkaMessageListenerContainer]
    2017-04-10T22:37:06-0300 1.3.1.RELEASE DEBUG
    DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor -
    Successfully started bean 'container1' 2017-04-10T22:37:06-0300
    1.3.1.RELEASE INFO DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor - Starting beans in phase 100
    2017-04-10T22:37:06-0300 1.3.1.RELEASE DEBUG
    DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor -
    Starting bean 'kafka-inbound-channel-adapter-testing' of type [class
    org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter]
    2017-04-10T22:37:06-0300 1.3.1.RELEASE INFO
    DeploymentsPathChildrenCache-0
    inbound.KafkaMessageDrivenChannelAdapter - started
    kafka-inbound-channel-adapter-testing 2017-04-10T22:37:06-0300
    1.3.1.RELEASE DEBUG DeploymentsPathChildrenCache-0 support.DefaultLifecycleProcessor - <strong>Successfully started bean
    'kafka-inbound-channel-adapter-testing'</strong></p>
  </blockquote>
  
  <p><strong>My question is:</strong> Why does the channel start automatically?</p>