4

I have a requirement where messages on the queue have to expire if the client doesn't read them after 60 seconds. Instead of deleting the messages, I want to send them to another queue like an "expired message" queue or something. I have read a little bit about the Dead Letter Queue and the Back Out queue, but I'm not sure if those are doing what I need.

Here is my code for expiring after 60 seconds:

MessageProducer producer = session.createProducer(destination);

producer.setTimeToLive(60 * 1000);

Any help is appreciated. Thanks.

Chris Ridmann
  • 2,836
  • 4
  • 18
  • 19

1 Answers1

2

by default, AMQ will send expired messages to the DLQ

see http://activemq.apache.org/message-redelivery-and-dlq-handling.html

Ben ODay
  • 20,784
  • 9
  • 45
  • 68
  • @chris, did you decide to use DLQ? It definitely has different purpose than you need (e.g. for "poison pill" messages). It would be good to specify name of the queue to send the message and time interval when the message considered "old". Have you accomplished that? – surlac Apr 23 '13 at 09:29