You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sdelanghe <st...@yandex.com> on 2013/12/10 15:26:50 UTC

Camel route exchange intermediate call

Hey everyone,

I have an web service endpoint. This message i need to keep. Before actually
passing this message on to the next component i need to call another web
service which changes the message entirely.
Looks as i lost my entire first message (body).

How can i keep my endpoint body while executing another route?
Is there an EIP pattern for this or do i need to duplicate the exchange?


Grtz
Stefaan





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-exchange-intermediate-call-tp5744569.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route exchange intermediate call

Posted by sdelanghe <st...@yandex.com>.
Thanks for your feedback.
It looked like i do not know my patterns to well ;-)

I simply had to use the enrich pattern and combine back my original and
resource exchange.

Thanks for the feedback



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-exchange-intermediate-call-tp5744569p5744593.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route exchange intermediate call

Posted by Stephan Burkard <sb...@gmail.com>.
Hi

You could simply save the original body into a Camel exchange-property
before it is modified. Later you can get the original body from the
property and set it into the body. But this works only if your exchange
does not get lost during processing (for example if you have a queue
inbetween).

Pseudo route code:

// save message body to exchange property to restore it later
.setProperty(SAVE_BODY, body())
... do other things ...
// restore original message body
.setBody(property(SAVE_BODY))
...continue with route ...

Cheers
Stephan


On Tue, Dec 10, 2013 at 3:26 PM, sdelanghe <st...@yandex.com>wrote:

> Hey everyone,
>
> I have an web service endpoint. This message i need to keep. Before
> actually
> passing this message on to the next component i need to call another web
> service which changes the message entirely.
> Looks as i lost my entire first message (body).
>
> How can i keep my endpoint body while executing another route?
> Is there an EIP pattern for this or do i need to duplicate the exchange?
>
>
> Grtz
> Stefaan
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-route-exchange-intermediate-call-tp5744569.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>