I like Raul's suggestion. It keeps the burden on the broker and the clients can be thin and simple.
On the other hand, you could do this on the client side with an aggregator. Just consume messages from a queue as quickly as they come in, and let the aggregator hold on to them for 2 mins and then release them. On Tue, Jul 30, 2013 at 12:59 PM, Raul Kripalani <r...@evosent.com> wrote: > 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 <shalom...@gmail.com> 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. > > > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta