I setup a Bean which currently listens successfully to exactly ONE Topic
"montopic20".
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
config
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
again?

Ben

    <bean id="jmsContainer"
class="org.springframework.jms.listener.SimpleMessageListenerContainer">
      <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>
    
    <bean id="myConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
      <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>
    <bean id="myDestination"
class="org.apache.activemq.command.ActiveMQTopic">
      <constructor-arg value="montopic20"/>
    </bean>
    <bean id="myMessageListener" class="mPackage.MyMessageListener">       
      <property name="appName" value="My Application"/>
    </bean>

-- 
View this message in context: 
http://old.nabble.com/How-to-let-ONE-bean-listen-on-MULTIPLE-Topics--SpringXML-config-in-activemq.xml-tp29449265p29449265.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to