You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Schaefer <sy...@yahoo.de> on 2013/11/07 14:15:44 UTC

write servlet response body in subsequent route

Hi there,

I built a route with a servlet-Consumer-Endpoint.
from(servlet)....to(direct:a)

Now I need to write a servlet response in a second route.
from(direct:a).process(...).exchange.getOut().setBody("abc")

However the caller does't receive the response body after calling the servlet route.
(Btw. it works when everything is put in a single route. However that doesn't fulfil my requirements.)

Any ideas how to achieve that?

regards
Chris

Re: write servlet response body in subsequent route

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

That is possible. The servlet component writes the response message
from what the message contains, when the routing is done.

But mind about using getOut. See this FAQ
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html



On Thu, Nov 7, 2013 at 2:15 PM, Christian Schaefer <sy...@yahoo.de> wrote:
> Hi there,
>
> I built a route with a servlet-Consumer-Endpoint.
> from(servlet)....to(direct:a)
>
> Now I need to write a servlet response in a second route.
> from(direct:a).process(...).exchange.getOut().setBody("abc")
>
> However the caller does't receive the response body after calling the servlet route.
> (Btw. it works when everything is put in a single route. However that doesn't fulfil my requirements.)
>
> Any ideas how to achieve that?
>
> regards
> Chris



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