You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tarjei Huse <ta...@scanmine.com> on 2010/10/02 12:15:56 UTC

Would support for a limit on the number of exchanges be a good idea?

 Hi, I've started using groovy + camel for doing various small batch
jobs like moving a set of messages from one jms queue to another, and I
have a usecase I think would be nice to have covered within the DSL if
possible:

An option to shutdown the route (and possibly the context) if a spesific
number of messages has passed through the route.

I.e. something like:

.from("activemq:someQueue").maxNumberOfMessages(39).to("activemq:otherQueue")

This is not very usefull when working on longrunning systems, but would
be very usefull when doing batchscripts or just wanting not to strain a
system.

Is this a good idea? Should I file a request for this in the JIRA?


-- 
Regards / Med vennlig hilsen
Tarjei Huse
Mobil: 920 63 413


Re: Would support for a limit on the number of exchanges be a good idea?

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Oct 2, 2010 at 12:15 PM, Tarjei Huse <ta...@scanmine.com> wrote:
>  Hi, I've started using groovy + camel for doing various small batch
> jobs like moving a set of messages from one jms queue to another, and I
> have a usecase I think would be nice to have covered within the DSL if
> possible:
>
> An option to shutdown the route (and possibly the context) if a spesific
> number of messages has passed through the route.
>
> I.e. something like:
>
> .from("activemq:someQueue").maxNumberOfMessages(39).to("activemq:otherQueue")
>
> This is not very usefull when working on longrunning systems, but would
> be very usefull when doing batchscripts or just wanting not to strain a
> system.
>
> Is this a good idea? Should I file a request for this in the JIRA?
>

We already good an API for that which is route policy. So you can
implement your custom policy and define it on any number of routes.
The RoutePolicy can then for example suspend/resume the routes
according to your logic.

http://camel.apache.org/routepolicy.html

>
> --
> Regards / Med vennlig hilsen
> Tarjei Huse
> Mobil: 920 63 413
>
>



-- 
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