davsclaus commented on pull request #4938: URL: https://github.com/apache/camel/pull/4938#issuecomment-771722558
Yeah but the onCompletion in the DSL was never intended to support triggering events at various routes during routing. However the DSL is so open that it appears you can do that. It was designed as a single action after the exchange was complete (on completion). And that you could specify that either as a global rule (context scoped), or override that and specify on the route. However the situation with sub routes having on completions wasn't taken well into the design. Nor that some users would specify 2+ on completions on a route, which meant that only the last would be used. So I regret implementing this feature soo poorly. However the real use-case it was solving was to do something around the consumer when the message is complete. However the point the action is triggered needed to have 2 modes (after some time) and hence we added before vs after consumer (the name may be poorly named). So all together there are now a permutation of ways that on completion can be specifyied in the route DSL, and on global level, and then with 2 modes, then the end user dont get a great understanding what would happen. Also when on completion is part of the DSL it becomes too easy to use, and therefore also mis-use for wrong use-cases. There are other ways with event listeners, route policy / route policy factory that separates this better from the DSL. With this PR then it opens up the possibilty to take in account onCompletions from sub routes. Need a bit more thinking. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org