Details
-
Enhancement
-
Resolution: Done
-
Major
-
1.5.0.0-fuse
-
None
-
None
Description
See attached test case that exposes the problem. Specifically, notice the extract below from file cxf-wsdl-first-robust-in-only/wsdl-first-cxf-camel-su/src/main/resources/camel-context.xml. The in-only message exchange fault is caught with exception org.apache.servicemix.jbi.FaultException while the robust-in-only message exchange fault is caught with exception org.apache.camel.CamelException. It would seem to make more sense for the same org.apache.servicemix.jbi.FaultException to be used in both cases.
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <route errorHandlerRef="deadLetterErrorHandler"> <from uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/PersonServiceProviderHandler" /> <onException> <!-- Catch exception from in-only message exchange --> <exception>org.apache.servicemix.jbi.FaultException</exception> <!-- Catch exception from robust-in-only message exchange --> <exception>org.apache.camel.CamelException</exception> <redeliveryPolicy maximumRedeliveries="0"/> <handled> <constant>true</constant> </handled> <to uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/async-bridge?mep=robust-in-only" /> </onException> <interceptor ref="handleFaultProcessor"> <to uri="jbi:service:http://servicemix.apache.org/samples/wsdl-first/pipeline?mep=robust-in-only" /> </interceptor> </route> </camelContext>
In particular, the org.apache.camel.processor.HandleFaultProcessor class converts non-empty Fault message to CamelException if it is robust-in-only since the robust-in-only supports the fault so the Exchange would contain a fault message while the in-only does not so the Exchange would only contain a non-empty exception instead. It had resulted inconsistency between in-only and robust-in-only for the exception being caught.
It might be good idea to consistently to throw JBIFaultException for both in-only and robust-in-only.