Hi John says at this thread http://old.nabble.com/Activemq-component-und-Delayer-ts27784918.html
That this questions is answered. On Thu, Mar 4, 2010 at 8:59 PM, John Landahl <[email protected]> wrote: > Hi all, a quick question about writing a polling consumer. Is it > possible to write a polling consumer with the Java DSL which polls a, > queue periodically? Ideally I'd like to have the "delay" and > "initialDelay" parameters of the File component, something like this: > > > from("activemq:deferred?initialDelay=10000?delay=14400000").to("activemq:main") > > The logic attached to the "main" queue sometimes finds items that need > to be deferred for a few hours. Those messages are routed to the > "deferred" queue, and after a few hours they need to go back into the > "main" queue to see if they can be processed. > > I've looked at the Timer and Quartz components, but I don't see how I > could use them without writing a separate bean, something like: > > > from("timer://deferredTimer?delay=10000?period=14400000").to("bean:deferredConsumer").to("activemq:main") > > I was hoping for something simpler than this, since the > deferredConsumer bean would be doing the same work as > .from("activemq:deferred"), but consuming messages periodically rather > than immediately. > > I've read the page on the Polling Consumer pattern, but the examples > all require dropping down to Java. I'm willing to do that, of course, > but thought I'd ask first to see if there's a way to do it at the > routing DSL level. > > thanks, > John > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
