DurableSubscribers

Hi All,
I am creating DurableSubscribers on a remote JMS topic. Here code snippet
public void connect(){
tcf = new STCTopicConnectionFactory(RibHost, rib_port);
          topicConnection = tcf.createTopicConnection();
          logger.debug(" topicConnection Created "+topicConnection);
          //Stop the connection if
          topicSession = topicConnection.createTopicSession(false,
          Session.AUTO_ACKNOWLEDGE);
          logger.debug(" TopicSession Created "+topicSession);
//           temporarly stop the connection for incomiing messages
          if(topicConnection!=null)topicConnection.stop();
          topic = topicSession.createTopic(TMP_PRC_TOPIC);
          logger.debug("Topic Created >>>>> "+topic);
          try{
               topicSubscriber = topicSession.createDurableSubscriber(topic, "SH_CLR_PRC_CHG");
          }catch(Exception e){
               System.out.println(" Exception Creating DurableSubscriber SH_CLR_PRC_CHG "+e.getMessage());
          logger.debug("Subscriber Created >>>>> "+topicSubscriber);
          topicSubscriber.setMessageListener(this);
          topicConnection.setExceptionListener(this);
          topicConnection.start();
Topic being created on subscription name SH_CLR_PRC_CHG and messages are comming. But When i restart my application,
1) If no messages are there on the subsction in remote jms server, the connection is created fine
2) If there are some messages are already in the subscription, the connection() throws exception saying the subsctiption already exists.
How do solve this problem. Before the creating topicSession.createDurableSubscriber(), is there any way i can check if the subsription name exists or not
Any advises please?

Well Aoifek this is how well i have understood things...
For the first question no... There is no such tool available with JMS
For the second one.....Client ids and durable subscriber names are essential in one way. PubSub domain with normal subscribers can work i.e receive messages provided only when the TopicSubscriber is active. Since it has this limitation maybe on creating a durable subscriber using createDurableSubscriber() the status of the created TopicSubscriber is maintianed by the provider so that any messages to the Topic with which this TopicSubscriber is associated to can receive the messages... I know this is not convincing but .... i have convinced myself with this explaination i got from someone.....
Well as per the reference implementation this setting of clientid should throw InvalidClientID exception.... and as for the duplicate messages received... i am too having the same problem... the behaviour is very ambigouous....
if any new findings please let me know...
Thanks

Similar Messages

Maybe you are looking for

  • Oracle 11g  Quartz Scheduler 1.8.5 running under JBOSS 5.1

    Basically I'm getting this error when running Quartz configured for the jobStore org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT I've got two data sources setup. One data source is setup to be looked up via JNDI (presumably for t

  • HI I HAVE PROBLEM WITH APPSTORE ON MY IPHONE,,,i CANT DOWNLOAD ANYTHINK,,,,BECAUSE MY SESSION HAS TIMED OUT...WHAT I HAVE TO DO NOW?

    HI I HAVE PROBLEM WITH APPSTORE ON MY IPHONE,,,i CANT DOWNLOAD ANYTHINK,,,,BECAUSE MY SESSION HAS TIMED OUT...WHAT I HAVE TO DO NOW?

  • Vendor master field updation

    We are using standard method  u201CMAINTAIN_BAPIu201D of class u201CVMD_EI_APIu201D to create vendor in ECC system. Method is creating vendor successfully but it is not updating comments(ADDR1_DATA-REMARK) field .All other vendors details updating su

  • BED,SED Zero in GR

    Hi all, I am not able to see the Excise details in My GR in MIGO transaction. Kindly explain me how the value of BED, SED etc flows to the GR document in SAP . That is exactly where should i check so that values of excise duties will flow to the MIGO

  • ITunes U in Korea?

    Is it really fair to advertise that "iTunes U is available no matter where you teach - at any college, university, or K-12 school" and "No matter what subject you teach or where you teach it, you can create a course and distribute it privately to you