tags:

views:

56

answers:

1

Hello,

I have a webservice which receives requests to perform some data transfer operations within an Oracle database (such transfer operation takes about 30mins to 2 hours). I designed the webservice to use JMS for these processes. Once a request arrives, a message is sent to ActiveMQ, there's a listener class that receives those and then calls a handler class to perform the operations. Now my question is: I'm quite new to JMS, and I know there are methods to approach messaging: pub/sub and queues, so in this case, is pub/sub the preferred approach or queues? What are the pros/cons of each?

Thanks!

+3  A: 

It's rather straightforward:

  • if you want multiple recipients to be notified for a message from one sender then use topics (pub/sub)
  • if you need point-to-point communication - i.e. one sender and one recipient, use queues
Bozho
So I guess that in your case, a queue would be better suited.
Maurice Perry