Propagate CXF Exceptions to Camel route

Solution Verified - Updated -

Issue

  • We want to propagate the cxf exceptions to the camel route so that we need to do some error handler Processing. There is not much documentation available for this scenario.
  • We have the following cxf endpoint bean configuration and the camel route. When an error happens in the cxf interceptors, we need to propagate the exceptions to the Camel route
<cxf:cxfEndpoint id="someID"
        address="${fuseEndpoint}"
serviceClass="com.redhat.ServiceImpl"
        wsdlURL="wsdl/some.wsdl"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    </cxf:cxfEndpoint>

<camelContext xmlns="http://camel.apache.org/schema/spring">
   <onException  useOriginalMessage="true">
         <exception>java.lang.Exception</exception>
             <handled>
                <constant>true</constant>
            </handled>          
        <bean ref="someBean" method="someMethod" ></bean>           
         </onException>         
    <route>
        <from uri="cxf:bean:someID?dataFormat=PAYLOAD"></from>
         <setExchangePattern pattern="InOnly"></setExchangePattern> 
          <to uri="{{inboudQueueName}}" ></to>                              
  </route>
</camelContext>
  • How to propagate the exceptions to the camel route , if any error happens in the cxf bus or interceptors?

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache CXF
  • Apache Camel

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In