Created
July 4, 2017 15:01
-
-
Save anonymous/195f2b6c835db82decf1649969a717fe to your computer and use it in GitHub Desktop.
Camel: How to break polling on pollEnrich() when an error is thrown from poll() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean rollback(Consumer consumer, Endpoint endpoint, | |
int retryCounter, Exception e) | |
throws Exception | |
{ | |
if (retryCounter < 3) { | |
Thread.sleep(500); | |
return true; | |
} | |
Exchange ex = endpoint.createExchange(); | |
ex.getIn().setBody(null); | |
((DefaultConsumer) consumer).getProcessor().process(ex); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment