Results 1 to 3 of 3

Thread: Multiple DefaultMessageListenerContainer

  1. #1
    Join Date
    Jun 2012
    Posts
    19

    Default 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. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,034

    Default

    Yes, but you won't know which topic the message came from.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jun 2012
    Posts
    19

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •