I'll explain a possible solution briefly. === Leverage JMS expiration and ActiveMQ individual Dead Letter Queue ===
Make your producers send messages with a JMS Time to Live of 2 minutes. If you can't change your producers, implement an AMQ Broker Plugin that will set the expiration inside the broker as soon as the message arrives. Set a destinationPolicy for the queue of interest with a custom, and use AMQ's individualDeadLetterStrategy [1] so that expired messages go to a dedicated queue whose name equals the name of the original destination, preceded by the "ActiveMQ.DLQ.Queue." prefix. Build your Camel route to consume from the DLQ instead of from the original queue. Your route will only consume messages that are 2 minutes old, or older. Does this help? Regards, *Raúl Kripalani* Apache Camel PMC Member & Committer | Enterprise Architect, Open Source Integration specialist http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Tue, Jul 30, 2013 at 6:57 AM, shin938 <[email protected]> wrote: > I have a simple route spring DSL ,activemq queue. I want to consume > messages > that are 2 minutes old and more. what would be my best approach? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/how-to-consume-messages-by-timestamp-tp5736463.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
