Posted: Wed May 25, 2011 6:40 am Post subject: Set expiry time for durable pub/sub Topics
Newbie
Joined: 25 May 2011 Posts: 9
Hi,
I just created a new "Topic" using MQ Explorer.
Then I wrote some pub/sub JMS code:
...
MQTopicSubscriber subscriber = (MQTopicSubscriber) session.createDurableSubscriber(topic, "mySub");
...
So far this works great.
But then I was asking myself the question: "What happens if a durable subscriber shuts down and never comes back up again?". The messages will be kept forever in the Queue.
Or is there a way to automatically purge messages from a Topic-Queue if they are not read for a too long time?
If the messages have an MQMD.expiry value set (by whatever puts them) they can auto-delete themselves.
However this is counter pattern for a durable subscriber and the durable pub/sub model. What you should do is find the subscription by looking at the topic and remove it administratively. Then you might need to run some maintenance program in the pub/sub area. _________________ MQ & Broker admin
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum