[jboss-user] [JBoss Messaging] - Re: JBM Topic Pub-Sub

timfox do-not-reply at jboss.com
Tue Jan 6 11:37:57 EST 2009


No, that's not how JMS durable subscriptions work. There are quite a few good JMS tutorials out there which should go through this.

In short:



  | MessageConsumer consumer = session.createDurableSubscriber(myTopic, "foo"); //Creates the durable subscription and returns a consumer on it
  | 
  | consumer.close() //Closes the consumer but the subscription is still active and receiving messages - you can close down the whole client at this point.. then.. some time later:
  | 
  | consumer = session.createDurableSubscriber(myTopic, "foo"); //Does not create a new durable sub since it already exists - but just returns a consuimer on it.
  | 
  | consumer.close() // closes the consumer - the subscription is still alive
  | 
  | session.unsubscribe("foo") // that's how you delete it - notice you've already closed the consumer/
  | 

HTH







View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199840#4199840

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199840



More information about the jboss-user mailing list