• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Subscribing to JMS mulitple topics

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic