I used something like this in the past for this. Note that I didn’t stop the route in between cycles - I just stopped the loop. return new RouteBuilder() { String routeId = "queue-processor"; int pollTimeout = 100; @Override public void configure() throws Exception { from( "timer://batch-timer?period=300000") .routeId(routeId) .loopDoWhile( body().isNotNull() ) .pollEnrich( "embedded-broker://queue:Testing", pollTimeout) .choice() .when( body().isNotNull() ) .log("Processing: ${body}") .to( "mock://target" ) .endChoice() .otherwise() .log( "Stopping polling loop") .end() .end() ; } };
Hope that helps > On Jun 9, 2016, at 12:58 PM, souciance <souciance.eqdam.ras...@gmail.com> > wrote: > > Well, if your route is called every 5 minutes surely unless you specified > otherwise the consumer should consume all the messages available on the > queue and not just once. I am not a hardcore amq guy but there should be a > way to tell it to consume until no more queues available. Usually its a > header or something like that. > > On Thu, Jun 9, 2016 at 4:36 PM, Guls [via Camel] < > ml-node+s465427n5783793...@n5.nabble.com> wrote: > >> Quartz will only help me call dequeue route every 5 minutes. But how will >> quartz help me dequeue all the message, that are accumulated for past 5 >> minutes?. >> >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5783739p5783793.html >> To start a new topic under Camel - Users, email >> ml-node+s465427n465428...@n5.nabble.com >> To unsubscribe from Camel - Users, click here >> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=> >> . >> NAML >> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >> > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5783739p5783804.html > Sent from the Camel - Users mailing list archive at Nabble.com.