How can I shutdown a standalone Apache Camel application in an automated way?

前端 未结 3 913
情话喂你
情话喂你 2021-01-03 01:59

I\'m trying to use Apache Camel to download and route files from an FTP server. However, files are only added to the FTP server once in a long while so having the program r

3条回答
  •  无人及你
    2021-01-03 02:45

    See this FAQ how to stop a route from a route: http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html.

    Then you can enable the option: sendEmptyMessageWhenIdle=true, and then in the route do a message filter, or content based route, and detect the empty message, and then stop the route and then after that CamelContext.

    Though I also think this question has been discussed before, so you can maybe find other SO questions or google etc. As there is also alternative ways of doing this.

提交回复
热议问题