I have 4 days experience with apache camel and hence this question.
What I would like to do is to add interceptor that would be triggered AFTER endpoint if condition met.
I am able to just add AFTER endpoint interceptor by doing this:
interceptSendToEndpoint(ENDPOINT_1)
.skipSendToOriginalEndpoint()
.to(ENDPOINT_1)
.afterUrl(AFTER_ENDPOINT_1);
I would assume that if I would like to add condition to this chain I would write this:
interceptSendToEndpoint(ENDPOINT_1)
.skipSendToOriginalEndpoint()
.choice()
.when(conditionIsMet).to(ENDPOINT_1).afterUrl(AFTER_ENDPOINT_1)
.otherwise(ENDPOINT_1);
But apache camel's API thinks different. ;) (like apple)
So the logic I am trying to achieve is: If condition met - then AFTER_ENDPOINT_1 should be executed, if condition is NOT met then AFTER_ENDPOINT_1 should NOT be executed.
Could you please assist with what should I write in this scenario? Perhaps I misuse interceptors - in this case, please direct me to the right path.