Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Subscribing to JMS mulitple topics  RSS feed

 
Naveen Sampra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have 3 topics set up.
test/books/Java
test/books/Linux
test/books/Perl
I want to subscribe only to the first two topics.
Do I need to call createDurableSubscriber() twice and create 2 subscribers and then call setMessageListener(listnerClass) on each of the subsribers ?
Is my approach correct ?
Is there any other way I can force a listener to listen only to the first two topics ?
~Naveen
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the same messageListener. You can check the destination by calling the getDestination method on Message object passed to the onMessage() object.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not subscribe to the topic that you are not intersted in. Creating a topic does not mean that everyone needs to subscribe to all topics.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!