Hi In Camel we have on completions http://camel.apache.org/oncompletion.html
Which support 2 scope levels: context or route. There is a rules of thumb currently: - If you define a route scope it overrides all global scoped. So its either or (not both). The issue I would like to discuss is this scenario: - If you route an exchange using multiple routes, eg send the exchange using direct/seda to another route with route scoped onCompletion Then this end user came up with this scenario http://camel.465427.n5.nabble.com/error-handling-and-transaction-question-tp3341490p3341490.html scenario 1 ========= from direct:A onCompletion -> "mock:a" end to XXX to direct:b from direct:b onCompletion -> "mock:b" end to YYY In this example the exchange is routed from A -> B using direct, which means that after route B the the Exchange will continue at route A, but there are no more outputs in the route so its done. What onCompletions would you expect to trigger? a) only "mock:a" because the Exchange is done at route A b) both "mock:a" and "mock:b because the Exchange is done (regardless in which route) Currently its b what's implemented in Camel 2.5 Now the scenario changes a bit as we use seda endpoints Scenario 2 ======== from direct:A onCompletion -> "mock:a" end to XXX to seda:b from seda:b onCompletion -> "mock:b" end to YYY In this example the exchange is routed from A -> B using seda, which means the exchange is transferred from A -> B and the on completions will be handed over. So when the exchange reaches the end of route B its done (it doesnt continue routing in route A). What onCompletions would you expect to trigger? a) only "mock:b" because the Exchange is done at route B b) both "mock:a" and "mock:b because the Exchange is done (regardless in which route) Currently its b what's implemented in Camel 2.5 The issues ======== 1) Should we change the default behavior to let Camel trigger route scoped on completions *only* if the exchange is done at that given route? 2) Or should we leave it as is? 3) Or add a new option to route scoped onCompletion so end user can decide? (atThisRouteOnly) = the new option (find a better name for it) onCompletion atThisRouteOnly -> "mock:a" end And if so, what should the default option for it be? -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
