title: Spring Integration manually start/stop channel adapter via control bus
body: <p>Is there anyway to manually start/init a channel adapter?</p>
  
  <p>I have two pairs of inbound/outbound adapters in my context.xml and would like to decide at runtime which one of them I want to get started.</p>
  
  <p>EDIT:</p>
  
  <p>The concrete scenario:<br>
  I have a client, that can be configured at runtime to be an mqtt publisher or subscriber.<br>
  My context.xml looks like this:</p>
  
  <pre><code>&lt;int-mqtt:message-driven-channel-adapter 
      client-id="foo"
      auto-startup="true"
      url="tcp://192.168.97.164:1883"
      topics="testtopic/#"
      channel="writeToFile" /&gt;
  
  &lt;file:outbound-channel-adapter
      id="writeToFile"
      auto-startup="true"
      directory="./test/out"
      delete-source-files="false"/&gt;
  
  &lt;int:transformer id="Transformer"
      ref="MessageTransformer"
      input-channel="readFromFile"
      output-channel="mqttOut"
      method="bytesFromFile" /&gt;
  
  &lt;bean id="MessageTransformer" class="MessageTransformer"/&gt;
  
  &lt;int-mqtt:outbound-channel-adapter 
      id="mqttOut"
      client-id="foo"
      url="tcp://192.168.97.164:1883"
      auto-startup="false"
      default-qos="1"
      default-retained="true"
      default-topic="testtopic/bla"
      /&gt;
  
      &lt;file:inbound-channel-adapter
      auto-startup="false" 
      id="readFromFile"
      directory="./test/in"
      filename-pattern="myFile*"&gt;
      &lt;int:poller id="poller"
          fixed-rate="5000" /&gt;     
  &lt;/file:inbound-channel-adapter&gt;
  </code></pre>
  
  <p><br>As you can see, I have two settings:<br>
  1. Subscriber case: Read mqtt message -> Write to file<br>
  2. Publisher case: Poll a file from directory -> Send via mqtt</p>
  
  <p>I decide at runtime what setting is to be applied.</p>
  
  <p>So can you kindly tell me how this control-bus thing would fit here exactly?</p>