klease opened a new pull request #5810:
URL: https://github.com/apache/camel/pull/5810
CAMEL-16374: extend OnCompletion to allow specification of both success and
failure routes.
The existing behavior with onCompleteOnly and nonFailureOnly flags is still
supported.
- To add a separate route for successful completion, use
"onSuccess().<route>."
- To add a separate route for a failed exchange, use "onFailure().<route>".
Sample route with Java DSL:
```
from("direct:start")
.onCompletion()
.onSuccess().to("mock:ok")
.onFailure().to("mock:error")
.end()
.to("mock:result");
```
One possible issue is in OnCompletionReifier at line 76 which sets the
OnCompletion target for the route.
```
route.setOnCompletion(getId(definition),
onSuccessProcessor != null ? onSuccessProcessor :
onFailureProcessor);
```
Previously there was only one processor possible; now if both success and
failure routes are present, only the onSuccessProcessor is added here. The
tests pass with this approach so it's not clear that the change is a problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]