camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyjshanghai <hyjshang...@gmail.com>
Subject What's the Difference between handled(false) and continued(true) (and more...)?
Date Thu, 14 Apr 2011 06:48:24 GMT
With regard to the "onException" Spring DSL, here are my questions based the
following 5 definitions (Example A-E).
Note that I replaced &lt; and &gt; with ( and )

1. What's the difference between handled(false) and continued(true)?
(Example C v.s. D)
According to my experience, only continued(true) will really continue
routing as if the exception has not happend.
handled(false) will break out routing, just like what handled(true) does. Is
this normal?

2. Similar to question 1, what's the difference between handled(true) and
continued(false)? (Example B v.s. E)
Should continued(false) also break out the normal routing on exception, just
like what handled(true) does?

3. A famous book on Camel says "OnException doesn’t handle exceptions by
default". 
However, Example A also breaks out normal routing on Exception, just like
what Example B does by my experience.
Is my experience conflicting with the Book's assertion that exception is not
handled by default?

Example A:
       (camel:onException)
            (camel:exception)java.lang.ArithmeticException(/camel:exception)
            (camel:process ref="arithmeticExceptionProcessor" /)
       (/camel:onException)

Example B:
       (camel:onException)
            (camel:exception)java.lang.ArithmeticException(/camel:exception)
           
(camel:handled)(camel:constant)true(/camel:constant)(/camel:handled)
            (camel:process ref="arithmeticExceptionProcessor" /)
       (/camel:onException)
	   
Example C:
       (camel:onException)
            (camel:exception)java.lang.ArithmeticException(/camel:exception)
           
(camel:handled)(camel:constant)false(/camel:constant)(/camel:handled)
            (camel:process ref="arithmeticExceptionProcessor" /)
       (/camel:onException)

Example D:
       (camel:onException)
            (camel:exception)java.lang.ArithmeticException(/camel:exception)
           
(camel:continued)(camel:constant)true(/camel:constant)(/camel:continued)
            (camel:process ref="arithmeticExceptionProcessor" /)
       (/camel:onException)
	   
Example E:
       (camel:onException)
            (camel:exception)java.lang.ArithmeticException(/camel:exception)
           
(camel:continued)(camel:constant)false(/camel:constant)(/camel:continued)
            (camel:process ref="arithmeticExceptionProcessor" /)
       (/camel:onException)
	  

--
View this message in context: http://camel.465427.n5.nabble.com/What-s-the-Difference-between-handled-false-and-continued-true-and-more-tp4302302p4302302.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message