camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: doTry, doCatch and recipientList
Date Mon, 03 Oct 2011 11:01:44 GMT
Hi

You are using an old release. In a later release there is .endTry()
which takes you back to the try .. catch scope.
Using onException on a route is the preferred way.

Alternative use direct inside the try .. catch.
And add a 2nd route from direct, and disable error handler on the 2nd route.


On Sun, Oct 2, 2011 at 6:10 PM, Pham Ngoc Hai <pngochai@yahoo.com> wrote:
> I'm using Camel 2.2.0-fuse-02-00 in Fure SMX.
> What I want is to catch any exception when sending to the recipientList, something like:
>
> from("...")
> .doTry()
> .recipientList(header(..))
> .doCatch(Exception.class)
> .to(..)
> .end()
>
> But Eclipse does not allow me to do .doCatch(..) after .recipientList(..)
> What I can do is to put a route scope onException after from(..) but what is the proper
way of handling exception in recipientList?
>
> Regards,
> Ngoc Hai
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message