You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rafal Janik <ra...@softwaremind.pl> on 2012/02/21 13:32:19 UTC

how call another service for part of the message in one route

Hi!

I'm looking for the best pattern to call another service for part of the 
data in one route.

In my case there is a message for example:

< a > < b > c < /b > < /a >

I want to send it from service X to Y but between  the consumer and 
provider I want to call service Z with c parameter to get some 
information and replace the c value with the service Z response.

One solution I can come up is to put a new bean  inside a route with 
setter and getter for a message, to store the message there, then send 
just c to service Z, and then merge the result from Z and from my bean 
getter and at least send it to the service Y.

But probably there there is a better pattern for that, isn't it?

regards


rafal




Re: how call another service for part of the message in one route

Posted by Rafal Janik <ra...@softwaremind.pl>.
thanks a lot,
I don't know how I missed that...


regards

rafal

On 21.02.2012 13:42, Reuben Garrett wrote:
> Rafal,
>
> this sounds like the Content Enricher pattern to me:
> http://camel.apache.org/content-enricher.html
>
> a bean or inlined fluent processor is probably a good solution - you seem to be on the right track
>
> ~ RNPG
>
> On Feb 21, 2012, at 6:32, Rafal Janik<ra...@softwaremind.pl>  wrote:
>
>> Hi!
>>
>> I'm looking for the best pattern to call another service for part of the data in one route.
>>
>> In my case there is a message for example:
>>
>> <  a>  <  b>  c<  /b>  <  /a>
>>
>> I want to send it from service X to Y but between  the consumer and provider I want to call service Z with c parameter to get some information and replace the c value with the service Z response.
>>
>> One solution I can come up is to put a new bean  inside a route with setter and getter for a message, to store the message there, then send just c to service Z, and then merge the result from Z and from my bean getter and at least send it to the service Y.
>>
>> But probably there there is a better pattern for that, isn't it?
>>
>> regards
>>
>>
>> rafal
>>
>>
>>


-- 
Software Mind 	

*Rafa? Janik*
Software Engineer
*Software Mind SA*
ul. Bociana 22A
31-231 Krakow
Polska

	Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
Mobile:+48 668 48 36 13
rafal.janik@softwaremind.pl <ma...@softwaremind.pl>
www.softwaremind.pl <http://www.softwaremind.pl>

Software Mind SA z siedziba; w Krakowie przy ul. Bociana 22A, 31-231 Krakow
NIP 9452012822, kapita? zak?adowy PLN 500,000.00 (w ca?os'ci wp?acony), 
KRS 0000300409
Sa;d Rejonowy dla Krakowa S'ródmies'cia w Krakowie, XI Wydzia? 
Gospodarczy KRS
Ta wiadomos'c' moz.e zawierac' materia?y poufne i obje;te tajemnica; 
zawodowa;, do wy?a;cznego uz.ytku odbiorcy (odbiorców). Surowo 
wzbronione sa; wszelkie zmiany, wykorzystywanie, przechowywanie, 
dystrybucja lub ujawnienie przez inne osoby. Jes'li nie jest Pan/Pani 
zamierzonym odbiorca; (lub osoba; upowaz.niona; do odbioru w imieniu 
odbiorcy), prosimy o kontakt z nadawca; przez wiadomos'c' zwrotna; oraz 
usunie;cie wszelkich kopii niniejszej wiadomos'ci. Poza tym poczta 
elektroniczna jest podatna na uszkodzenia danych, przechwytywanie, 
sabotaz., nieupowaz.nione zmiany i wirusy. Wysy?amy i odbieramy 
wiadomos'ci poczty elektronicznej wy?a;cznie na takiej zasadzie, z.e nie 
ponosimy odpowiedzialnos'ci za jakiekolwiek tego typu uszkodzenia, 
przechwycenia, sabotaz., zmiany lub wirusy, ani jakichkolwiek 
konsekwencje tego typu okolicznos'ci.


Re: how call another service for part of the message in one route

Posted by Reuben Garrett <re...@gmail.com>.
Rafal, 

this sounds like the Content Enricher pattern to me: 
http://camel.apache.org/content-enricher.html

a bean or inlined fluent processor is probably a good solution - you seem to be on the right track

~ RNPG 

On Feb 21, 2012, at 6:32, Rafal Janik <ra...@softwaremind.pl> wrote:

> Hi!
> 
> I'm looking for the best pattern to call another service for part of the data in one route.
> 
> In my case there is a message for example:
> 
> < a > < b > c < /b > < /a >
> 
> I want to send it from service X to Y but between  the consumer and provider I want to call service Z with c parameter to get some information and replace the c value with the service Z response.
> 
> One solution I can come up is to put a new bean  inside a route with setter and getter for a message, to store the message there, then send just c to service Z, and then merge the result from Z and from my bean getter and at least send it to the service Y.
> 
> But probably there there is a better pattern for that, isn't it?
> 
> regards
> 
> 
> rafal
> 
> 
>