Reputation: 53
I am trying to pull files from a remote server and if not able to connect to remote server want to implement below scenarios:
Upvotes: 0
Views: 720
Reputation: 325
I would use a polling strategy for this. So the commit and rollback methods will decide on what to do if there is an issue with the route of some sort
Upvotes: 0
Reputation: 2678
In your route you need a bean that connects to the remote server. If it can't connect, it should through an exception.
Then add an onException handler in your route onException(CannotConnectException.class) .maximumRedeliveries(3) .processRef("doSomething")
The "doSomething" process has to take care of stop polling and inform consumer part of the route. For example, to stop polling you could call a method of the connection bean to stop it polling. The best solution is really going to depend on how you rest of your system fits together.
Upvotes: 1