Hello All,
Consider a simple camel route like this that invokes a one way service:
<camel:route errorHandlerRef="myDeadLetterErrorHandler">
<camel:from uri="inputDir"/>
<camel:setHeader
headerName="operationName"><constant>opName</constant></camel:setHeader>
<camel:setHeader
headerName="operationNamespace"><constant>opNamespace</constant></camel:setHeader>
<camel:to uri="cxf:bean:myService?dataFormat=PAYLOAD"/>
</camel:route>
If the endpoint you are invoking is down, CXF will throw an exception:
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.6.0_29]
at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)[:1.6.0_29]
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)[:1.6.0_29]
at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)[:1.6.0_29]
at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)[:1.6.0_29]
I thought that the error handler that I set on the route would handle this
for me and I could configure the retries and retry interval. However, this
exception never makes it back to the exchange on the route.
I tried to set up a CXF phase interceptor to handle this, but I was unable
to put the CXF exception onto the Camel exchange. Please see this related
post on the CXF list for more details on the interceptor configuration:
http://cxf.547215.n5.nabble.com/CXF-Camel-JMS-Endpoint-exception-handling-td4471174.html#a5490748
I also tried to grab the out of band headers from the exchanges and check
the HTTP status for a 200 response, but these appear to only be available in
POJO mode. I figured I could throw an exception for a status other than 200
since I have a one way service.
I find this strange. Should an exception thrown in the CXF interceptor
chain makes it way back to the Camel exchange? Am I missing something here?
Thanks,
Yogesh
--
View this message in context:
http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5491102.html
Sent from the Camel - Users mailing list archive at Nabble.com.