camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Enrich message using default components
Date Fri, 12 Jun 2009 04:29:09 GMT
On Thu, Jun 11, 2009 at 5:39 PM, ErwinK<> wrote:
> Hello,
> I am having a problem enriching my data when using for example the
> jdbc-endpoint. I store my original message in the header and put the query
> in the body. However after the request to the jdbc-endpoint I have lost al
> my headers.
> I tried to use setOutHeader("name", header("original_data") but then my IN
> body is reset to null?
Using the jdbc component you cannot keep both the original IN body and
the result from the JDBC (= the OUT body).
If you want to keep the original IN body store it as a

When you route an exchange Camel will often use the pipes and filters
and thus if you route to some destination
after the jdbc Camel will use OUT as Message as IN for the next
processor and thus the original IN is lost.

So if you want to keep the IN body store it in an exchange property.
These are kept forever.

> Is there a recommended solution for this problem type?

However in Camel 2.0 we have a new enrich DSL that allows you to be
100% in control how to merge data obtained
from another endpoint with the current exchange.

Instead of using .to you use .enrich instead and use an aggregation
strategy to merge the result.

> Regards,
> Erwin
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Open Source Integration:

View raw message