If I use Spring Integration with XML-Configuration, a Message Listener can be done like the following:
<int:channel id="handlerChannel"/>
<bean class="org.springframework.integration.endpoint.EventDrivenConsumer">
<constructor-arg name="inputChannel" ref="handlerChannel"/>
<constructor-arg name="handler" ref="alertHandler" />
</bean>
<int-jms:message-driven-channel-adapter channel="handlerChannel" container="listenerContainer" />
<bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" scope="prototype">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="destination" ref="defaultDestination"/>
</bean>
The problem is: I want to create own ListenerContainers at the runtime... how I can get the same result or rather how can I combine a MessageHandler with a MessageListenerContainer?
thx and greeting
However, why use Spring Integration at all here; you can wire a
MessageListener
into the message listener container directly.