Announcement Announcement Module
Collapse
No announcement yet.
Listening to multiple Queue Destinations. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Listening to multiple Queue Destinations.

    Hi,

    I am listening messages from a Queue using a DefaultMessageListenerContainer. Now in the same application i want to listen to two different queues. Name and other details for both the queues i know before starting the application.
    1. On the first queue i have 10 listeners up and running using the property maxConcurrentConsumers.

    2. On the second queue that this application wants to listen i want only one listener up and running.

    Questions;
    1. How can i configure two listeners in the same application?

    2. I want that one listener should be dedicated to the second queue that i am setting up and there should not be a case that this listeners starts taking message from the first queue as load on it was less.

    3. Since the processing done on the messages is same, i would like to keep the onMessage method and processing after that same for messages coming from both the queue. Any issues with have same omMessage() method for both the queues?


    My current code base for listener set up is:
    <bean id="instrumentListenerContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory">
    <ref bean="myConnectionFactory" />
    </property>
    <property name="messageListener">
    <ref bean="instrumentListener" />
    </property>
    <property name="maxConcurrentConsumers">
    <value>10</value>
    </property>
    <property name="destination">
    <bean class="com.tibco.tibjms.TibjmsQueue">
    <property name="address">
    <value>${INSTRUMENT.IN}</value>
    </property>
    </bean>
    </property>
    <property name="autoStartup">
    <value>false</value>
    </property>
    <property name="sessionTransacted">
    <value>true</value>
    </property>
    <property name="sessionAcknowledgeMode">
    <value>2</value>
    </property>
    <property name="recoveryInterval">
    <value>30000</value>
    </property>
    </bean>


    Any pointers for the same would be helpful.

  • #2
    Simply setup 2 DMLC beans each pointing to 2 different destinations

    Comment


    • #3
      Thanks for the input.

      Comment

      Working...
      X