Hi,

why don't timer component fit your requirements ?

from("timer://pollTheDatabase?delay=30000").to("mbatis:selectAllAccounts").to("activemq:queue:allAccounts");


would execute the query configured un mybatis every 30 seconds... and put
the result on the queue allAccounts...
You can either process the result as a list or have each individual row sent
further in the route...
Of course, you have to have a way to mark the rows as processed. This can be
done with the consumer.onConsume parameter.

Hope it helps,

Mike


2011/3/31 Mark Webb <[email protected]>

> I want to create a route that will query a database for new rows
> periodically.  If a new row is found I would like to put the
> information from that row into the route for processing.  I have been
> looking at the timer and quartz components and can't seem to get
> either one to fit quite right with me requirement.
>
> Is there another Camel component that will do this?  I have looked
> through the Camel book and found ScheduledPollConsumer, but that just
> looks like I would need to add in my own "sleep".
>
> I tried looking at the unit tests in
>
> /camel/trunk/camel-camel/trunk/camel-core/src/test/java/org/apache/camel/component/timer
> and could not find anything that fits either.
>
> Any other suggestions?
>
> Thanks,
> Mark
>

Reply via email to