We could also add a route policy out of the box that checks for those
empty messages and then auto stop a route.
http://camel.apache.org/routepolicy

There is a number of people asking how to stop a route from a route,
or when to stop when there is no more data etc.
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

On Fri, Nov 20, 2015 at 10:29 AM, Siano, Stephan <[email protected]> wrote:
> Hi,
>
> The file (and ftp) component has an option sendEmptyMessageWhenIdly.
>
> You could do the following: have one route that consumes from the FTP server 
> (with sendEmptyMessagesWhenIdle set to true). From there send the messages 
> (via direct) to another route. That route checks for empty message bodies and 
> if an empty message body is found it stops the first route with the 
> controlbus endpoint.
>
> Best regards
> Stephan
>
> -----Original Message-----
> From: Ishada [mailto:[email protected]]
> Sent: Freitag, 20. November 2015 10:20
> To: [email protected]
> Subject: RE: Stop the route when there is no file on the SFTP component
>
> I need to stop the route if there are no files on the endpoint.
> My sequence of steps are as follows
> 1> Get Payload form JMS Queue.
> 2>Delete and zip all the files on the SFTP server.
> 3>Move the payload to the SFTP.
>
> So in the 2nd step I am acquiring lock and once the files are deleted, I am
> moving to the 3rd step.
> But If there are no files on the SFTP server to delete, I am not able to
> stop the route and move to the 3rd step.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Stop-the-route-when-there-is-no-file-on-the-SFTP-component-tp5774141p5774144.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to