You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Sebastian Gomez <sa...@gmail.com> on 2009/11/26 21:02:40 UTC

Perfect Error Handling in servicemix-camel-2009.01

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/users@servicemix.apache.org/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

Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Sebastian Gomez <sa...@gmail.com>.
Hi Willem,

Thanks for answering. I see it's being thrown from servicemix-camel
component, but is it this this how the component should work? Shouldn't it
convert the JBI exception into a Camel exception so as to permit the Camel
error handler to be in charge of it?

Sebastian Gomez.

On Mon, Nov 30, 2009 at 2:41 PM, Willem Jiang <wi...@gmail.com>wrote:

>
> 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 users@camel.apache.org.
>>
>> Hope someone can help me out.
>>
>> Sebastian Gomez.
>>
>> On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com>
>> 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/users@servicemix.apache.org/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>
>>> <http://my.namespace/%7DMyService>
>>>  endpoint: MyEndpoint
>>>  operation: {http://my.namespace/}MyOperation<http://my.namespace/%7DMyOperation>
>>> <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
>>>
>>>
>>
>

Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Sebastian Gomez <sa...@gmail.com>.
Hi Willem,

Thanks for answering. I see it's being thrown from servicemix-camel
component, but is it this this how the component should work? Shouldn't it
convert the JBI exception into a Camel exception so as to permit the Camel
error handler to be in charge of it?

Sebastian Gomez.

On Mon, Nov 30, 2009 at 2:41 PM, Willem Jiang <wi...@gmail.com>wrote:

>
> 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 users@camel.apache.org.
>>
>> Hope someone can help me out.
>>
>> Sebastian Gomez.
>>
>> On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com>
>> 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/users@servicemix.apache.org/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>
>>> <http://my.namespace/%7DMyService>
>>>  endpoint: MyEndpoint
>>>  operation: {http://my.namespace/}MyOperation<http://my.namespace/%7DMyOperation>
>>> <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
>>>
>>>
>>
>

Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Willem Jiang <wi...@gmail.com>.
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 users@camel.apache.org.
> 
> Hope someone can help me out.
> 
> Sebastian Gomez.
> 
> On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com> 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/users@servicemix.apache.org/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
>>
> 


Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Willem Jiang <wi...@gmail.com>.
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 users@camel.apache.org.
> 
> Hope someone can help me out.
> 
> Sebastian Gomez.
> 
> On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com> 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/users@servicemix.apache.org/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
>>
> 


Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Sebastian Gomez <sa...@gmail.com>.
Forwarding to users@camel.apache.org.

Hope someone can help me out.

Sebastian Gomez.

On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com> 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/users@servicemix.apache.org/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
>

Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Sebastian Gomez <sa...@gmail.com>.
Forwarding to users@camel.apache.org.

Hope someone can help me out.

Sebastian Gomez.

On Thu, Nov 26, 2009 at 9:02 PM, Sebastian Gomez <sa...@gmail.com> 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/users@servicemix.apache.org/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
>

Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Willem Jiang <wi...@gmail.com>.
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 <sa...@gmail.com>:
>> 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/users@servicemix.apache.org/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
>>
> 


Re: Perfect Error Handling in servicemix-camel-2009.01

Posted by Gert Vanthienen <ge...@gmail.com>.
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 <sa...@gmail.com>:
> 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/users@servicemix.apache.org/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
>