You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/07/07 17:33:28 UTC

[GitHub] [camel] klease opened a new pull request #5810: Camel-16374

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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] klease commented on pull request #5810: Camel-16374

Posted by GitBox <gi...@apache.org>.
klease commented on pull request #5810:
URL: https://github.com/apache/camel/pull/5810#issuecomment-886233310


   Closing this pull request; will create a new one which allows two onCompletions.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] klease commented on pull request #5810: Camel-16374

Posted by GitBox <gi...@apache.org>.
klease commented on pull request #5810:
URL: https://github.com/apache/camel/pull/5810#issuecomment-876706077


   Thanks for the quick review and comments. I did consider that option but thought it might be more confusing. I'm on vacation this coming week but will plan to rework the solution as you suggest when I'm back.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] klease closed pull request #5810: Camel-16374

Posted by GitBox <gi...@apache.org>.
klease closed pull request #5810:
URL: https://github.com/apache/camel/pull/5810


   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #5810: Camel-16374

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #5810:
URL: https://github.com/apache/camel/pull/5810#issuecomment-876369721


   Thanks for starting working on this.
   
   One thing I would like to avoid was to introduce a new defintion for just this "not so common" use-case.
   If we had use for OnSuccess and OnFailure in other EIPs etc then it could make sense, like we have with OnWhen.
   
   The model already allows to add multiple OnCompletion, so we could also look at using the model as it is, as you can add 2 x onCompletion and have it as onSuccessOnly and onFailureOnly. Its more the reifier / processor logic that then needs to deal with this, and that is a bit deeper how to do that.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org