JBoss Community

JMS-messages with an expiry date (time-to-live) never expire

created by Online Metalhead in JBoss Messaging - View the full discussion

I would like to delete any jms-messages which could not be delivered to the subscriber after a small period.

 

So in my code I set the default timeToLive of my TopicPublisher to 30 seconds and I set the message timeToLive to 30 seconds, but the messages never seem to get expired.

 

Some pieces of java-code:

[code]

TopicPublisher publisher = ...;

publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

publisher.setTimeToLive(30000);

 

publisher.publish(message, DeliveryMode.NON_PERSISTENT, publisher.getPriority(), 30000);

[/code]

 

I also tried to set the DLQ and the ExpiryQueue, but it makes no difference: the messages stay in the conventional JMS-queue...

 

Can someone point me in the right direction how I can solve this?

 

Thanks in advance...

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community