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

  • Listening to multiple Queue Destinations.


    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.

    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 name="messageListener">
    <ref bean="instrumentListener" />
    <property name="maxConcurrentConsumers">
    <property name="destination">
    <bean class="com.tibco.tibjms.TibjmsQueue">
    <property name="address">
    <property name="autoStartup">
    <property name="sessionTransacted">
    <property name="sessionAcknowledgeMode">
    <property name="recoveryInterval">

    Any pointers for the same would be helpful.

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


    • #3
      Thanks for the input.