Hi,

From the stack trace it looks like the exception is throw from ServiceMix-Camel component, so you can't check it with the error handler in the CamelContext.


Willem

Sebastian Gomez wrote:
Forwarding to [email protected].

Hope someone can help me out.

Sebastian Gomez.

On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <[email protected]> wrote:

Hi everyone,

I've been reading all the documentation I've found on error handling in
Camel, but it looks there are so many ways to do it I can't make up my mind
on which is best. I guess depending on the scenario there will be better and
worse combinations. Hope someone can recommend me a way of handling faults
given my scenario:

* I'm using servicemix-camel-2009.01, i.e. Camel 1.6.0, therefore I can't
use doTry/doCatch/doFinally.
* I want to handle absolutely ALL exceptions and faults generated in the
routes, and hande them with custom processors.

My main concern is that I'm using a splitter (serial, not parallel) that
generates a few messages that call a web service (on cxf-bc). If the web
service doesn't answer on time, Camel receives a JBI Fault due to timeout
and doesn't seem to know how to handle it. It then throws a RuntimeException
that, although Camel is supposed to carry on processing in case of
exception, stops the whole flux of messages. I've seen something related to
the piece of code where the exception is thrown has been talked about here
[1]. I've tried adding errorHandlers, onExceptions and tryBlocks to the
route but none of them seem to catch the exception and continue processing
messages.

Could someone help me out indicating the preferred fault handling solution
for my scenario or giving me some kind of solution to my particular
error? I'll paste below the stack trace in case someone finds it useful.

Thanks in advance,

Sebastian Gomez

[1] http://www.mail-archive.com/[email protected]/msg05915.html


ERROR - CamelJbiComponent              - Error processing exchange InOut[
  id: ID:XXX.XXX.XXX.XXX-12531fce6e9-4:14
  status: Active
  role: consumer
  service: {http://my.namespace/}MyService<http://my.namespace/%7DMyService>
  endpoint: MyEndpoint
  operation: 
{http://my.namespace/}MyOperation<http://my.namespace/%7DMyOperation>
  in: <?xml version="1.0" encoding="UTF-8"?><xxx/>
  fault: <?xml version="1.0" encoding="UTF-8"?><JBIFault xmlns="
http://java.sun.
com/xml/ns/jbi/wsdl-11-wrapper"><detail xmlns="">Read timed
out</detail></JBIFau
lt>
]
java.lang.RuntimeException: javax.jbi.messaging.MessagingException: Fault
not su
pported
        at
org.apache.servicemix.camel.JbiExchange.createMessage(JbiExchange.jav
a:179)
        at
org.apache.servicemix.camel.JbiExchange.createFaultMessage(JbiExchang
e.java:156)
        at
org.apache.servicemix.camel.JbiExchange.createFaultMessage(JbiExchang
e.java:37)
        at
org.apache.camel.impl.DefaultExchange.getFault(DefaultExchange.java:2
59)
        at
org.apache.servicemix.camel.JbiExchange.getFault(JbiExchange.java:81)

        at
org.apache.servicemix.camel.JbiExchange.getFault(JbiExchange.java:37)

        at
org.apache.camel.impl.DefaultExchange.getFault(DefaultExchange.java:2
54)
        at
org.apache.servicemix.camel.JbiExchange.getFault(JbiExchange.java:76)

        at
org.apache.servicemix.camel.JbiExchange.getFault(JbiExchange.java:37)

        at
org.apache.servicemix.camel.CamelConsumerEndpoint.process(CamelConsum
erEndpoint.java:64)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:627)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:598)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
ncBaseLifeCycle.java:535)
        at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
yncLifeCycleWrapper.java:60)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:623)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:172)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:168)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.jbi.messaging.MessagingException: Fault not supported
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(Me
ssageExchangeImpl.java:366)
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setFault(Mess
ageExchangeImpl.java:290)
        at
org.apache.servicemix.camel.JbiExchange.createMessage(JbiExchange.jav
a:166)
        ... 20 more



Reply via email to