Frère Jac
Frère Jac

Reputation: 11

ActiveMQ with more than one Listener

I am using it with spring. Now I have the following setting:

   <!--异步调用消息 -->
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="cacheConnectionFactory"></property>
    <!-- <property name="destination" ref="ptpQueue"></property> -->
    <property name="destination" ref="topicQueue"></property>
    <property name="messageListener" ref="objHelper"></property>
    <property name="sessionAcknowledgeModeName" value="AUTO_ACKNOWLEDGE"/>
</bean>

My messageListener only listens ref="objHelper" but now I want it to listen on both ref="objHelper" and ref="bexHelper" !

Both my objHelper and bexHelper have implemented MessageListener and have a method onMessage(){………… } but I have no idea how to do this.

Upvotes: 1

Views: 131

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55750

The Spring MessageListenerContainer can only be configured with exactly one message listener. So this is not possible.

Why do you need to use 2 message listeners on the same message listener container?

Upvotes: 1

Related Questions