Mule - How to do a choice/when based on http response codes?

前端 未结 2 1669
予麋鹿
予麋鹿 2021-01-28 15:35

I need to be able to perform certain actions based on the http response code I get back from an http outbound endpoint. For instance if I get a 500 error or a 302 redirect or a

2条回答
  •  [愿得一人]
    2021-01-28 16:29

    Seba is right but that is not enough.

    By default, if an client or server error is detected in an HTTP outbound interaction (ie response code >= 400), Mule will treat the response as an error and will break the flow execution and call the exception strategy to deal with the error.

    You need to deactivate this behaviour before doing the HTTP outbound interaction in order to have the rest of the flow (your choice router) be called. So you need this:

    
    

    before your HTTP outbound endpoint.

提交回复
热议问题