Re: How to stop a dynamic route

2016-06-13 Thread Quinn Stevenson
I haven’t tested this code, but something like this should do what you’re after from("file://source").routeId( "my-route") .filter( header("CamelBatchComplete").isEqualTo( true ) ) .toF( "controlbus://route?routeId=%s&action=%s", "my-route", "stop") .end(); Hope that he

Re: How to stop a dynamic route

2016-06-08 Thread Brad Johnson
Processing the files once is what the idempotent flag is for as noted. It won't reprocess the same files. The route is still there but it won't continually respin over your file. On Wed, Jun 8, 2016 at 10:48 AM, Daniel P22 wrote: > I need to start the route, process the files once and then stop

Re: How to stop a dynamic route

2016-06-08 Thread Daniel P22
I need to start the route, process the files once and then stop and remove the route. Then the route maybe in future can be started again and I need the route process the same files again. Maybe I dont need to destroy the route but at least stop. And I have to stopped when the CamelBatchComplete

Re: How to stop a dynamic route

2016-06-08 Thread Brad Johnson
I'm going to echo Quinn's question, why do you think you need to remove the route? Even if it is only used once and only once you can (a) disable or (b) make sure it only processes files idempotently so that you don't end up reprocessing the file. You may have a compelling reason I just don't kno

Re: How to stop a dynamic route

2016-06-08 Thread Daniel P22
Quinn and Ranx, guys have an example for controlbus, I don't understand how works and how can I use it. I read camel.apache.org/controlbus.html -- View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783611.html Sent from the Camel - Users maili

Re: How to stop a dynamic route

2016-06-07 Thread Quinn Stevenson
One problem with the control bus is you won’t be able to remove the route - only stop it. I’m not sure I understand exactly why you need to removed the route. Would it be possible to use the same “route”, but dynamically configure it to process a batch and then stop? So when you trigger it ag

Re: How to stop a dynamic route

2016-06-06 Thread Brad Johnson
Personally I'd still be tempted to simply use the flags on the endpoint input if possible and not worry about enabling or disabling the route but the control bus is the way to go, as Quinn pointed out, if you really want that fine a control. On Sun, Jun 5, 2016 at 12:07 PM, Daniel P22 wrote: >

Re: How to stop a dynamic route

2016-06-05 Thread Daniel P22
Once only, and then the route stop and remove from the camel context. -- View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783477.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to stop a dynamic route

2016-06-05 Thread Brad Johnson
Once only? Or only the first time it sees a unique file name? On Sat, Jun 4, 2016 at 1:26 PM, Daniel P22 wrote: > Ranx I just want to execute the route once, and stop and remove when the > batch are complete, just that, don't look at the code, thank you so much. > > > > -- > View this message

Re: How to stop a dynamic route

2016-06-05 Thread Daniel P22
Ranx I just want to execute the route once, and stop and remove when the batch are complete, just that, don't look at the code, thank you so much. -- View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783469.html Sent from the Camel - Users m

Re: How to stop a dynamic route

2016-06-04 Thread Brad Johnson
Just to see if this is doing what you really want it to, put a lot statement right after the SMB read. I'm having difficulties reading the code due to the formatting issues in email and not being entirely sure of your goals here. I can say that I don't recall the last time I had to use Thread.sl

Re: How to stop a dynamic route

2016-06-03 Thread Daniel P22
Ranx explain to you, I have a route A, in that route you are going to put a file with ammdd date format. Then Im going to create a dinamic route in the Camel Context using that date, this route is what you see in the example, I just wanna from the smb endpoint the files according that date.

Re: How to stop a dynamic route

2016-06-03 Thread Brad Johnson
I can't read the format of the code but as Quinn pointed out you can use the control bus but I have to ask what is the purpose/reason for shutting the route down? Are you just running the batch once or are you re-enabling it at some other time? Just from what I can see this looks like it is going

Re: How to stop a dynamic route

2016-06-03 Thread Quinn Stevenson
You could use the control bus to stop the route ( http://camel.apache.org/controlbus.html ) > On Jun 2, 2016, at 5:06 AM, Daniel Pompa wrote: > > If you see, I have a do-while monitoring the value of the var > CamelBatchComplete, then when is true, sto

Re: How to stop a dynamic route

2016-06-02 Thread Daniel Pompa
If you see, I have a do-while monitoring the value of the var CamelBatchComplete, then when is true, stop and remove the route from Camel Context. I don't like this. My question is, there a better way to stop and remove the route when the Batch finish? Using the RouteBuilder for example. Thanks.

Re: How to stop a dynamic route

2016-06-02 Thread souciance
So, what is your question? On Thu, Jun 2, 2016 at 11:56 AM, Daniel Pompa [via Camel] < ml-node+s465427n5783385...@n5.nabble.com> wrote: > Hi, I created a project, I want that the route stops when the Camel Batch > are complete, I used > SimpleScheduledRoutePolicy but you have to define a start an