activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BenXS <>
Subject How to let ONE bean listen on MULTIPLE Topics? SpringXML config in activemq.xml
Date Tue, 17 Aug 2010 13:55:47 GMT

I setup a Bean which currently listens successfully to exactly ONE Topic
The SpringXML setup for this bean in activemq.xml is as shown below.

How can I let the same Bean listen to multiple different topics in parallel?
In other words: Which minimal changes do I have to apply to the SpringXML
below to listen e.g. to a second topic "montopic35" as well?

Can I simply add a second <constructor-arg /> ?

Or do I really have to setup a bean twice with full SpingXML declaration


    <bean id="jmsContainer"
      <property name="autoStartup" value="true"/>
      <property name="connectionFactory" ref="myConnectionFactory"/>
      <property name="destination" ref="myDestination"/>
      <property name="messageListener" ref="myMessageListener"/>
      <property name="acceptMessagesWhileStopping" value="true"/>
    <bean id="myConnectionFactory"
      <property name="brokerURL" value="tcp://localhost:61616"/>
    <bean id="myDestination"
      <constructor-arg value="montopic20"/>
    <bean id="myMessageListener" class="mPackage.MyMessageListener">       
      <property name="appName" value="My Application"/>

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message