Hi,
I am using Spring Integration M4 and I want to start the MessageBus manually, but I found that even I set the following:
<bean id="internal.MessageBus" class="org.springframework.integration.bus.Message Bus" ">
<property name="autoStartup" value="false"/>
</bean>
The MessageBus is still started by the ApplicationContext, I trace the spring framework source, seems the problem is due to Spring will trigger the start() for all beans implement LifeCycle interface:
In AbstractApplicationContext:
//---------------------------------------------------------------------
// Implementation of Lifecycle interface
//---------------------------------------------------------------------
public void start() {
Map lifecycleBeans = getLifecycleBeans();
for (Iterator it = new LinkedHashSet(lifecycleBeans.keySet()).iterator(); it.hasNext(){
String beanName = (String) it.next();
doStart(lifecycleBeans, beanName);
}
publishEvent(new ContextStartedEvent(this));
}
Any suggestion on this problem?
Thanks
Ryan


{
Reply With Quote