title: initialization and spring integration channels
body: <p>I need to load bunch of data right after spring initialization, just once. 
  In my scheme i have service activator that works with control bus (sends messages to control bus channel). 
  Creating service that sends this bunch of data after initialization doesnt help, this <a href="http://forum.spring.io/forum/spring-projects/integration/96221-jdbc-inbound-channel-adapter-for-doing-only-a-single-query-at-runtime" rel="nofollow">96221-jdbc-inbound-channel-adapter-for-doing-only-a-single-query-at-runtime</a> doesnt help also - Im getting <code>org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers</code>. Tried several ways, including <code>BeanPostProcessor</code>, <code>MethodInvokingFactoryBean</code> but still have feeling channels arent initilized yet at moment of method call. 
  Any ways to solve this problem?</p>
  
  <p>upd: <code>ApplicationListener&lt;ContextRefreshedEvent&gt;</code> worked as magic. Thx for advice </p>
  
  <p>upd2:<br>
  config of problem part below. The trick is in <em>cbManager</em>, that sends message to controlBus, calling method of <em>providerManager</em> bean. (<code>"@providerManager.add(headers.providerConfig)"</code>). 
  Works good with http-inbound part, but <em>jdbcPoller</em> task is to do same in initialization. <code>ApplicationListener</code> solved my problem but if there is something i dont know or alternatives, Id be glad to know </p>
  
  <pre><code>    &lt;int:control-bus input-channel="controlBusMainChannel"/&gt;
  
      &lt;int:channel id="controlBusMainChannel" /&gt;
      &lt;int:channel id="cbRequests" /&gt;
      &lt;int:channel id="cbReplies" /&gt;
      &lt;int:channel id="postRequests" /&gt;
  
      &lt;bean id="cbManager" class ="com.dph.hlss.bus.ViaBusProviderManager"&gt;
          &lt;constructor-arg name="channel" ref="controlBusMainChannel" /&gt;
      &lt;/bean&gt;
  
       &lt;int-http:inbound-gateway id="cbPostController"
          request-channel="cbRequests"
          reply-channel="cbReplies"
          path="/controlbus/providers" 
          request-payload-type="com.dph.hlss.bus.providermanager.model.ProviderAddDTO"
          supported-methods="POST"
          payload-expression="body"   
      &gt;
          &lt;int-http:header name="requestId" expression="T(java.util.UUID).randomUUID().toString()"/&gt;
      &lt;/int-http:inbound-gateway&gt;
  
      &lt;int:service-activator input-channel="cbRequests" ref="cbInbound"/&gt; 
  
      &lt;int:gateway id="cbInbound" default-request-channel="cbInbRequests"  error-channel="cbErrorHandleMessages" /&gt;
  
      &lt;int:transformer input-channel="cbErrorHandleMessages" output-channel="cbReplies" ref="errorTransformer" method="transform"/&gt;
  
      &lt;int:payload-type-router input-channel="cbInbRequests" &gt;
          &lt;int:mapping type="com.dph.hlss.bus.providermanager.model.ProviderAddDTO" channel="postRequests"/&gt;
      &lt;/int:payload-type-router&gt;
  
      &lt;int:service-activator id="addProvider" input-channel="postRequests" output-channel="cbReplies" ref="cbManager" method="add" /&gt;
  
      &lt;bean id="providerManager" class="com.dph.hlss.bus.ProviderCommandManagment" &gt;
          &lt;property name="providerManager" ref="searchProviderManager"/&gt;
          &lt;property name="factory" ref="abstractProvidersFactory" /&gt;
  
      &lt;/bean&gt;
  
      &lt;bean id="jdbcPoller" class="com.dph.hlss.bus.JDBCPoller" &gt;
          &lt;property name="accepter" ref="cbManager" /&gt;
      &lt;/bean&gt;
  
      &lt;bean class="com.dph.interfaces.spring.SpringBeanLauncher"&gt;
          &lt;property name="launchableBean" ref="jdbcPoller" /&gt;
          &lt;property name="contextId" value="/search-facade" /&gt;
          &lt;property name="rootContextId" value="org.springframework.web.context.WebApplicationContext:" /&gt;
      &lt;/bean&gt;
  </code></pre>