How to get Camel FTP to fetch only once on demand

后端 未结 2 1341
半阙折子戏
半阙折子戏 2021-01-17 04:23

I\'m fairly new to Camel.

I\'ve been trying to get Camel to fetch a single file via FTP only once, on demand. I couldn\'t get it to work. Here is what I\'ve tried.

相关标签:
2条回答
  • 2021-01-17 04:34

    You can use a CountDownLatch to stop the route from a route as specified here - http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html. It works like charm for me..

    0 讨论(0)
  • 2021-01-17 04:48

    So the solution I found is using the scenario #1, but stop and restart the route.

    exchange.getContext().stopRoute(routeId);
    exchange.getContext().startRoute(routeId);
    
    0 讨论(0)
提交回复
热议问题