This content has been marked as final.
Show 4 replies
-
1. Re: How to set up a durable subscriber?
ataylor Jul 17, 2008 3:20 AM (in response to janylj)Are you sure you are starting the connection? i.e. connection.start()
-
2. Re: How to set up a durable subscriber?
janylj Jul 17, 2008 12:22 PM (in response to janylj)Yes. I started the connection.
Actually I am using the same code to connect to a topic. Everything runs OK. For the durable subscriber, I just look up another destination.if (client.isDurable()) { String clientName = getClientName(); LOG.info("Creating durable subscriber (" + clientName + ") to: " + dest.toString()); jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName); } else { LOG.info("Creating non-durable consumer to: " + dest.toString()); jmsConsumer = getSession().createConsumer(dest); }
-
3. Re: How to set up a durable subscriber?
jmesnil Jul 17, 2008 12:41 PM (in response to janylj)"janylj" wrote:
if (client.isDurable()) { String clientName = getClientName(); LOG.info("Creating durable subscriber (" + clientName + ") to: " + dest.toString()); jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName); } else { LOG.info("Creating non-durable consumer to: " + dest.toString()); jmsConsumer = getSession().createConsumer(dest); }
In both case, you use the same destination "dest".
Do you mean that if you client is durable, the jmsConsumer does not receive any message from the topic? while it is not durable, it receives message? -
4. Re: How to set up a durable subscriber?
janylj Jul 17, 2008 2:45 PM (in response to janylj)Exactly.
The destination is what I posted above. When it's not a durable subscriber, receiving is OK. But when it's a durable subscriber, it doesn't get any message.