Announcement Announcement Module
Collapse
No announcement yet.
Multiple DefaultMessageListenerContainer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple DefaultMessageListenerContainer

    I need to define 2 DefaultMessageListenerContainers in my applicationContext.xml - can they both have the same messageListener defined?

    Basically can one messageListener receive messages from 2 different topics:
    for ex:

    Code:
    <bean id="messageListener" class="myListener" />
    
      <bean id="jmsContainer" 
    		class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    		<property name="connectionFactory" ref="cachedConnectionFactory" />
    		<property name="destination" ref="topic1" />
    		<property name="messageListener" ref="messageListener" />
    		<property name="sessionTransacted" value="true"/>
    		<property name="pubSubDomain" value="true"/>
    	</bean> 
    	
       <bean id="jmsContainer2" 
    		class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    		<property name="connectionFactory" ref="cachedConnectionFactory" />
    		<property name="destination" ref="topic2" />
    		<property name="messageListener" ref="messageListener" />
    		<property name="sessionTransacted" value="true"/>
    		<property name="pubSubDomain" value="true"/>
    	</bean>

  • #2
    Yes, but you won't know which topic the message came from.

    Comment


    • #3
      Originally posted by Gary Russell View Post
      Yes, but you won't know which topic the message came from.
      Thanks for confirming the functionality

      Comment

      Working...
      X