On Mon, May 9, 2011 at 11:58 AM, edge <[email protected]> wrote: > I've implemented my own component and am using ScheduledPollConsumer to poll > stuff from a database. > However, if I try to change the rate of polling as follows - the poll > method is never called. > > public PendingPersistentMessageConsumer(PendingPersistentMessageEndpoint > endpoint, Processor processor) { > super(endpoint, processor); > this.endpoint = endpoint; > //this.setDelay(1000); // <-- this works > this.setDelay(1); > this.setTimeUnit(TimeUnit.SECONDS); > } >
You have to set the initialDelay as well, as they are both using SECONDS as time unit. And the initialiDelay is by default 1000. So in your case it would wait 1000 seconds before polling the 1st time :) So doing this this.setInitialDelay(1); should help. > using 1000 (ms) and not changing the time unit works fine. It looks like a > bug in the scheduler or am I misinterpreting something here? > I'm using camel 2.7.0 > > -- > View this message in context: > http://camel.465427.n5.nabble.com/ScheduledPollConsumer-bug-tp4381448p4381448.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
