camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Mistroni <mmistr...@gmail.com>
Subject Camel Exception Handling issue
Date Fri, 24 Aug 2012 20:27:12 GMT
HI all
 i have implemented exception handling in my camel app this way

<camel:route>
            <camel:from uri="seda:processBloombergShares" />
            <camel:bean ref="bloombergServiceActivator" method="fetchData"
/>
            <camel:multicast>
                <camel:to
uri="bean:sharesEndpointBean?method=handleBloombergShare" />
                <camel:to uri="seda:report" />
            </camel:multicast>
            <camel:onException>
                <camel:exception>java.lang.Exception</camel:exception>
                <camel:handled>
                    <camel:constant>true</camel:constant>
                </camel:handled>
                <camel:to
uri="bean:exceptionHandler?method=handleException" />
            </camel:onException>
 </camel:route>

and Here's my exception handler

public void handleException(Exchange exchange) {
        LOGGER.info("-------Handling exceptions with exchange:");
        LOGGER.info("exception:" + exchange.getException());

However it appears that exchange.getException() is null somehow, as from
the logs i can see

INFO ExceptionHandler * exception:null


what am i doing incorrect?  shall i remove  <camel:handled>?


w/kindest regards
 marco

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message