• 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

JMS Durable Subscriber Example

 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Please does anyone have a durable subscriber example in jms through which I can clear my concepts ?. I have understood the theory, but I would like to have a code example through which I can clear my concepts. Where does clientID figure in the code and how is it used in durable subscriber example ? Please do explain me. I am using JBoss 5.0.0-G.A. application server. Any help would be highly appreciated.

Thanks.
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check out this article on ibm developer works, it explains why you need clientId:
IBM Websphere Technical Journal
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I read this article. I read the description of ClientID but I still didn't get where clientID is used in the code. Please help me understand wherein the code do we use clientID.

I am using JBoss-5.0.0GA as my app. server. I have set the client ID in the <mbean> tag in the file connection-factories-service.xml. Now I didn't get where do we use the client ID in durable subscription code. Please help me understand this. Thanks.

 
Shane Lee
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You set the client id in your jms connection. For my example i am using websphere MQ 7.0 as my jms messaging provider and my enterprise application is deployed on WAS 6.1, so i set the client id on my mq connection factory properties. My durable subscriber MDB then looks up this connection factory as an administered object.

Hope that makes sense.
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is clientID same as subscription name ?
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any update on this query ???
 
Shane Lee
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a durable subscritpion you need combination of topic name, clientId and subscriber name. When you create your TopicSubscriber from your jms session you need to provide your topic and a name for the subscriber. This uniquely identifies the subscriber to the topic.

See http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/TopicSession.html#createDurableSubscriber(javax.jms.Topic,%20java.lang.String)
reply
    Bookmark Topic Watch Topic
  • New Topic