Results 1 to 3 of 3

Thread: Configuring multiple queue

  1. #1

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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.

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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

Posting Permissions

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