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

  • Configuring multiple queue

    Hi,

    I want to listen asyncronously listen to queue.
    One way of doing is with Message Driven Bean,other would be by a Message Driven POJO,where I would have to write a web application for it.
    Are there any other ways in Spring to implement the above scenario.
    Also if i go for Message Driven POJO ,I need to configure a Message Driven POJO such that the it can listen to multiple queues.
    What configuration should I put in the applicationContext.xml

  • #2
    You do not need a web application for a Message-driven POJO. Any Spring application can support that. For example, you can have a main() method that simply creates the ApplicationContext by pointing to a configuration file. If that configuration file includes a Message-driven POJO, then it will start the background process that listens to the Queue.

    Comment


    • #3
      Regarding your second question... you can listen to multiple queues with the same POJO by providing more than one <listener> sub-element within a <listener-container> (both elements are defined in the 'jms' namespace). Here's a simple example:
      Code:
      <jms:listener-container>
          <jms:listener destination="queue1" ref="somePojo" method="someMethod" />
          <jms:listener destination="queue2" ref="somePojo" method="someMethod" />
      </jms:listener-container>
      For more information, you might want to consult the reference manual:
      http://static.springsource.org/sprin...rence.html#jms

      HTH,
      Mark

      Comment

      Working...
      X