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: doCatch returns null
Date Sun, 18 Nov 2012 11:41:49 GMT
Hi


In your code there may be a bug in doCatch I am not sure. Though can
you try adding a extra step after the process in the doCatch.


doCatch(...)
   .process( ...)
   .to("log:foo")   <-- add extra step
.end()


Also see this FAQ about using getOut or getIn
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html


On Fri, Nov 16, 2012 at 11:25 AM, maxence.dewil <the.maxxxx@gmail.com> wrote:
> Hi,
>
> tested with camel 2.10.1 and 2.10.2 :
>
> *When I turn the route :*
>
> from("cxf:/myWebService?serviceClass=com.x.MyWebService").routeId("MyRoute")
> .process(new Processor() {
>     @Override
>     public void process(Exchange exchange) throws Exception {
>        exchange.getOut().setBody(new Output());
>     }});
>
> *into :*
>
> from("cxf:/myWebService?serviceClass=com.x.MyWebService").routeId("MyRoute")
> .doTry()
>     .process(new Processor() {
>         @Override
>         public void process(Exchange exchange) throws Exception {
>            throw new IllegalStateException();
>         }});
> .doCatch(IllegalStateException.class)
>     .process(new Processor() {
>         @Override
>         public void process(Exchange exchange) throws Exception {
>             exchange.getOut().setBody(new Output());
>         }});
> .end();
>
> *Then the response body of myWebService is empty.*
>
> Is it possible that my route returns something in a doCatch() ?
>
> Any help would be appreciated
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/doCatch-returns-null-tp5722851.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message