• Post Reply Bookmark Topic Watch Topic
  • New Topic

Listener listening to multiple queues  RSS feed

 
Alissa Horner
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible for a listener to listen to multiple queues? Do you have any sample code that demonstrates this? I have a class that implements MessageListener.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why not. You'd create an instance of this MessageListener and then pass it to the addMessageListener method of any number of objects. (Unless you're talking about some particular object which works in some framework which prevents that, I suppose.)

You might have to be careful and watch out for race conditions in your MessageListener code, if it was possible for it to be called simultaneously from more than one object which it was listening to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!