• 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

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am developing a sample JMS application. I am using IBM WAS 7.0. I am using the default message provider of WAS as the JMS provider.
The application has TPublisher.java (puts the messages in the topic) and TSubscriber.java (reads the message from the topic).

I have configured the SIB, Topic, Topic Connection Factory (standalone application to access the topic) and activation specifications (for MDB to access the topic). I was able to create a durable MDB subscriber by defining the clientID and subscription name in the activation specifications. I am also successful in creating a non-durable standalone consumer.

I want to create a durable subscriber from the standalone application that consumes my TPublisher.java. I know I have to play around clientID and subscriber name but not sure what needs to be done.

My question is where to define clientID and subscriber name in the
(1) standalone publisher program (if any)
(2) where and what to configure in the admin console of WAS 7
(3) what to add in the consumer program so that my standalone consumer becomes a durable one.

I tried giving the clientID ("durableIDCF") in the topic connection factory (in the admin console) and used the below code in the consumer.
session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
connection.setClientID("durableIDCF");
topicsubscriber = session.createDurableSubscriber(topic,"mySub"); // not sure where else to initiate/define the subscriber name of "mySub"

However, I get the below error. I tried googling but didn't get a clue as what needs to be done. Any help would be greatly appreciated.
javax.jms.IllegalStateException: CWSIA0023E: The client ID for this connection is read-only.
at com.ibm.ws.sib.api.jms.impl.JmsConnectionImpl.setClientID(JmsConnectionImpl.java:431)

Regards,
Kiran.
 
K Kiran Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I found the solution. Donot use connection.setClientID("durableIDCF"); in the subscriber code as the clientID already exists i.e., in the connection factory the client was already defined. So I was trying to define it again and its failing. So summary is
(1) Dont do anything in the publisher
(2) Define the clientID in the Connection Factory
(3) Give some unique name to the subscription name in the subscriber code.

Regards,
Kiran.
reply
    Bookmark Topic Watch Topic
  • New Topic