camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: Only trigger route if condition is fulfilled?
Date Thu, 16 Jun 2016 10:58:03 GMT
Hi Souciance,

If I stop the route, how do I start it later? I want it to run again later if the stop-file
is removed. I might just want to stop it for a few minutes, or I want to stop it "indefinitely"
(like, months). Either way, I don't want to have to change the config and restart Camel for
the change to have effect.

Basically, I want the equivalence of a "stop/pause" and "start/continue" button for a singular
route, but to be able to do it at a terminal. And I want the current state (ie running or
paused) to remain unchanged even if Camel itself is restarted. In my mind, using a stop-file
on disk to indicate this would be a perfectly simple solution to this.

And regarding your suggestions, how would they make sure that the payload file remains on
disk, even when the file component (the entry point of the route) has delete=true set?


-----Original Message-----
From: souciance [] 
Sent: Thursday, June 16, 2016 12:41 PM
Subject: Re: Only trigger route if condition is fulfilled?


Depends, if you want to stop the route completely maybe use the controlbus component to send
a stop action.

If you use the java dsl, after your condition == true you can add something like this:


If you just want to stop the route from proceeding or stop consuming, use the stop statement
.stop() in the java dsl or set the exchange property exchange.setProperty(Exchange.ROUTE_STOP,



On Thu, Jun 16, 2016 at 12:28 PM, jimi.hullegard [via Camel] <> wrote:

> Hi,
> I would like an easy way to stop a route from processing any more 
> messages, by defining some boolean condition so that the route should 
> run only if the condition is true.
> The condition doesn't have to be connected in any way with the payload.
> Instead it could involve performing a http GET and only proceeding if 
> the result is a "200 OK", or check that some file exist, or doesn't 
> exist, in some folder somewhere. It is that last part I need in my 
> project. I would like to be able to stop a route by simply placing a 
> file "camel.stop" or similar in some folder.
> Adding this logic in a custom processor class doesn't help, because 
> the route in question starts with a File component that has 
> delete=true, and if the file "camel.stop" is present then I don't want any files deleted.
> What would you say is the best way to achieve this?
> Regards
> /Jimi
> ------------------------------
> If you reply to this email, your message will be added to the 
> discussion
> below:
> ulfilled-tp5784112.html To start a new topic under Camel - Users, 
> email
> To unsubscribe from Camel - Users, click here 
> <
> bscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpb
> C5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> <
> o_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namesp
> ew.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%2
> 1nabble%3Aemail.naml>

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message