camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: How to enrich message with the result of other invocation
Date Mon, 05 Nov 2007 18:29:13 GMT
>  Thats a good idea. I have needed this myself. Its along the lines of
> http://www.enterpriseintegrationpatterns.com/DataEnricher.html
> ContentEnricher  .
>
> One way to do this would be to define ContentEnricherProcessor and the
> Resource would be replaced by an invocation of any Processor. The original
> message (before enrichment) could be saved of in either a header or could be
> appended with the new message (after enrichment) with the out response of
> the processor.

Anyway now it can easily be solved using such construct which is just
clear without any magic behind:

            setHeader("original", body()).
            setBody(constant("some other request")).
            to("someEndpoint").
            setOutHeader("additionalData", body()).
            setOutBody(header("original"));

Unfortunately two last lines doesn't work because of
http://issues.apache.org/activemq/browse/CAMEL-208 but I've already
send a patch for this problem.

Of course if we can find out an easy and natural way of expressing
ContentEnricherProcessor in DSL/XML it could be interesting
improvement.

Romek

Mime
View raw message