You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "pawel.jasinski" <pa...@gmail.com> on 2008/10/14 17:18:04 UTC

exchange propagation question

hi all,

i have the following route setup:

from("cxf:bean:consumerEndpoint").
  to("seda:inbound").
  transform(constant(Messages.wrap(Messages.getEchoTestResponse())));

from("seda:inbound").
  delayer(150).
  process(new RequestTypeConverter()).
  setHeader("destination-uri", constant("foo-bar")).
  to("cxf:bean:producerEndpoint");

I assumed that seda make a copy of the exchange, and effectively insulate
what is happening with messages/exchanges on the first route, from what is
happening on the second.
However I discovered that the above routes seem to be pathological case
where messages on the second route gets the content of transform argument
from the first one. 
It has to be timed with delayer (transform is send back before further
processing is done on second route).
It is triggered in setHeader step. Without the setHeader, there is no
message content modification.

I have work around for my case, I make extra copy of the exchange with
DelegateProcessor:

from("seda:inbound").
  delayer(150).
  intercept(new ExtraExchangeCopy()).
  process(new RequestTypeConverter()).
  setHeader("destination-uri", constant("foo-bar")).
  to("cxf:bean:producerEndpoint");

The question: is making extra explicit copy of exchange the way to go?
Is there some magic recipe I am missing? 

--Pawel

-- 
View this message in context: http://www.nabble.com/exchange-propagation-question-tp19975713s22882p19975713.html
Sent from the Camel - Users mailing list archive at Nabble.com.