camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Burkard <>
Subject Re: Have available data in several points of the route?
Date Wed, 28 Mar 2012 06:31:11 GMT
Actually there is no requirement that the called services know camel.

You can for example save the original message body to an exchange
property then convert the body to the needed "request object" that is
the parameter for the called service. Then the service response
replaces the message body again. Now you can use the response directly
or store it also in an exchange property and finally restore the
original message body by getting it from the initially saved exchange

Pseudo code of such a route:

// save message body to exchange property to restore it later
.setProperty(SAVE_BODY, body())
// create service request parameter
.bean(typeConverter, "toServiceRequest")
// call searchService
.bean(serviceBean, "methodName")
// save service response to exchange property
.setProperty(RESPONSE, body())
// restore original message body
continue with route ...

On Wed, Mar 28, 2012 at 01:25, Bilgin Ibryam <> wrote:
> I think then you can use something like claim-check pattern
> to store and access your data from
> anywhere in the route.
> Bilgin
> On 27 March 2012 16:39, m.jimen.blazquez <> wrote:
>> Hi,
>> Actually the exchange does not fit  because I have to interact with
>> services
>> which doesn't understand CAMEL so the body in exchange will always be the
>> returned object of the invoked method, won't it?
>> best regards
>> --
>> View this message in context:
>> Sent from the Camel - Users mailing list archive at

View raw message