>From http://activemq.apache.org/message-redelivery-and-dlq-handling.html: "By default, ActiveMQ will not place undeliverable non-persistent messages on the dead-letter queue." So unless you enable the processNonPersistent option described in that page, you can't.
If you do enable that option, here's an example of consuming the advisory messages: https://github.com/tabish121/ActiveMQ-HowTo/blob/master/advisory-consumer/src/main/java/org/apache/activemq/recipes/AdvisoryConsumerApp.java. That consumer just gets the original destination, but you can instead access the originalMessageId property as documented here: http://activemq.apache.org/advisory-message.html Tim On Sep 21, 2016 11:16 PM, "chetansistla" <sistlache...@gmail.com> wrote: > Hi, > > Iam building an application on activemq where iam sending a message from > producer where my delivery mode is NON_PERSISTENT (*iam not dealing with > PERSISTENT delivery mode and i know it will be stored in DLQ-which is not > my > design*)and have set a time to live for the message using > producer.setTimeToLive(2000).As the functionality says the message will > expire in 2 seconds. > > I see that the expired messages are enqueued in the > *ActiveMQ.Advisory.Expired.Queue* in the topic section of activeMQ admin > console i.e. *http://localhost:8161/admin/topics.jsp. > * > My question is how do i *iterate* over the *ActiveMQ.Advisory.Expired. > Queue* > so that i can access the *MessageID* of the expired message.Any code > example > would be great. > > > > > -- > View this message in context: http://activemq.2283324.n4. > nabble.com/Iterate-over-non-persistent-activemq-expired- > messages-in-ActiveMQ-Advisory-Expired-Queue-tp4716777.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >