camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Can a camel route be run as a batch (peridiocally) in ActiveMQ config
Date Fri, 26 Jun 2009 05:11:47 GMT
On Fri, Jun 26, 2009 at 1:21 AM, Serge Merzliakov<> wrote:
> Hello,
>   I have created a simple camel route which copies messages from one JMS
> queue to another. When I insert this into my activemq.xml config file it
> works fine.
>        <cm:camelContext id="camel">
>                <cm:route >
>                        <cm:from uri="jms:queue:input" />
>                        <cm:from uri="jms:queue:output" />
>                </cm:route>
>        </cm:camelContext>
> Is there a way of running this periodically, e.g. every 10 minutes?
> I know i can just run it from a simple java class and a script file (using
> Spring Application Context to start it up) and using cron/autosys/etc. I was
> hoping to be able to do this in the activemq config as it provides a single
> consistent way of handling the JMS infrastructure and message flows - i.e.
> one less moving part.

What you have above in the route is an event driven consumer

It triggeres when an event occurs, such as a new jms message arrives.
As such scheduling this is not really easy as it kinda "listen all the time".

To have better control with this you can use polling consumer instead

And you can combine this with the camel-quartz component to scheduled
using cron syntax

Or the regular JDK timer

See the "timer based polling consumer" here

> Regards,
> Serge
> --
> View this message in context:
> Sent from the Camel - Users (activemq) mailing list archive at

Claus Ibsen
Apache Camel Committer

Open Source Integration:

View raw message