0

After upgrading from Camel 2.1 to 2.17 and some code modification we are having some problems with the exception handling in Camel. We send message from app A to app B. The happy flow works fine, but the unhappy flow doesn't.

We send the message to cause an exception but it is not correctly handled in the onexception block.

Actually, we see the following tracelog: ProcessTaskEx - message received, but I don't see: ProcessTaskEx - exception

The exception we get from Camel is:

camel exchange failed without an exception: <SOAP-ENV:Fault xmlns:SOAP-ENV>

Our route looks like this, any idea what the problem could be? Thank you very much for your time community! :)

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="switchyard://ProcessTaskEx"/>
        <log message="ProcessTaskEx - message received: ${body}" loggingLevel="DEBUG" logName="WebServiceQueues" />
        <to uri="switchyard://RequestCapacity"/>
        <onException>
            <exception>java.lang.Exception</exception>
             <exception>webservicequeues.utilities.WebServiceQueueException</exception>

            <log message="ProcessTaskEx - exception" loggingLevel="DEBUG" logName="WebServiceQueues" />
            <redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="60000" maximumRedeliveryDelay="900000" retriesExhaustedLogLevel="INFO" retryAttemptedLogLevel="INFO"/>
            <handled>
                <constant>true</constant>
            </handled>

            <log message="Failed after Retry.Sending ProcessTask Request to Error Queue" loggingLevel="ERROR" logName="WebServiceQueues" />
            <to uri="switchyard://ErrorProcessTaskExQueue"/>
        </onException>
    </route>
</routes>
builder-7000
  • 7,131
  • 3
  • 19
  • 43

1 Answers1

0

As fas as I remember, faults are not handled by default. In order to enable this a property must be set: handleFault="true". It can be set for the whole Camel context or for individual routes.

Example for a route in XML:

<route handleFault="true">
...
</route
burki
  • 6,741
  • 1
  • 15
  • 31
  • Thank you. Indeed. I tested it but what happens next is very strange... It enters in a perpetual loop ignoring the maximumRedeliveries clausule: Failed delivery for (MessageId: ID-UW205584-58231-1527668174534-39-248 on ExchangeId: ID-UW205584-58231-1527668174534-39-24). On delivery attempt: 0 Failed delivery for (MessageId: ID-UW205584-58231-1527668174534-39-248 on ExchangeId: ID-UW205584-58231-1527668174534-39-24). On delivery attempt: 1 And then it remains in On delivery attempt: 1 perpetually – user9868874 Jun 01 '18 at 12:00
  • Well, currently no idea about this. But let the community focus on it in your [other, dedicated question](https://stackoverflow.com/questions/50601473/onexception-maximumredeliveries-ignored) about this :-) – burki Jun 01 '18 at 12:18