camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boller, Stefan" <stefan.bol...@sap.com>
Subject FW: Meaning of Exchange Property CamelFailureHandled
Date Wed, 18 May 2016 17:42:35 GMT
Hi Camel friends,

Can anybody explain the meaning of the Exchange Property "CamelFailureHandled"? Especially,
what's the difference to "CamelExceptionHandled" and "CamelErrorHandlerHandled"?

I don't know, if it's a bug, but I found the following method in RedeliveryErrorHandler (
2.16.2), which is called in method prepareExchangeAfterFailure, if the failure is not handled:

    private void prepareExchangeAfterFailureNotHandled(Exchange exchange) {
        log.trace("This exchange is not handled or continued so its marked as failed: {}",
exchange);
        // exception not handled, put exception back in the exchange
        exchange.setProperty(Exchange.ERRORHANDLER_HANDLED, Boolean.FALSE);
        exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class));
        // and put failure endpoint back as well
        exchange.setProperty(Exchange.FAILURE_ENDPOINT, exchange.getProperty(Exchange.TO_ENDPOINT));
        // and store the route id so we know in which route we failed
        UnitOfWork uow = exchange.getUnitOfWork();
        if (uow != null && uow.getRouteContext() != null) {
            exchange.setProperty(Exchange.FAILURE_ROUTE_ID, uow.getRouteContext().getRoute().getId());
        }
    }

I wonder, why the "CamelFailureHandled" is not removed like the  "CamelErrorHandlerHandled".
At the beginning of the method prepareExchangeAfterFailure in method setFailureHandled the
exception is removed from the exchange and the property "CamelFailureHandled" is set. In my
point-of-view both methods should be symmetric and CamelFailureHandled should also be removed
in prepareExchangeAfterFailureNotHandled. What do you think?

Best regards,

STefan


Dr. Stefan Boller
Development Architect, HANA Cloud Integration,
SAP SE, Dietmar-Hopp-Allee 16, 69190, Walldorf, Germany

T +49 6227 7-67168, M +49 151 62345455, E stefan.boller@sap.com

Please consider the impact of the environment before printing this e-mail.


Pflichtangaben/Mandatory Disclosure Statement:
http://www.sap.com/company/legal/impressum.epx/

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen
enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme
des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte
benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank.

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential
information. If you have received this e-mail in error, you are hereby notified that any review,
copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy
the original transmittal.
Thank you for your cooperation



Mime
View raw message