Just a quick note, Camel 2.1 will be released this week :)
Willem
Gert Vanthienen wrote:
Sebastian,
It looks like you bumped into
http://issues.apache.org/activemq/browse/SMXCOMP-651. This issue was
one of the reasons why we significantly refactored the
servicemix-camel components for the 2009.02 version. I don't think
there's really a workaround for this issue with the 2009.01 version,
but you should be able to use the latest snapshot for the 2009.02
version from
https://repository.apache.org/content/repositories/snapshots/org/apache/servicemix/servicemix-camel/2009.02-SNAPSHOT/.
This version also includes Camel 2.1-SNAPSHOT, which in itself
contains a lot of improvements to error handling.
We are working towards a new release of ServiceMix in the next few
weeks, so you wouldn't have to work with the snapshot for too long.
Regards,
Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/
2009/11/26 Sebastian Gomez <[email protected]>:
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
endpoint: MyEndpoint
operation: {http://my.namespace/}MyOperation
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