Components setting data on OUT

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Components setting data on OUT

Claus Ibsen-2
Hi

The OUT message really starts to irritate me.

We have various components that set data on the OUT body and then the
Pipeline will use this result as IN for then next node.
What happens is then whatever headers etc from IN is lost. Then you
cant really route and have your headers preserve during the entire
route.

We might wanna give this a thought in Camel 2.0?
- Pipeline to always add headers from IN to OUT, so headers is preserved
- Components to enforce MEP and only set data on OUT if its InOut
- Components to add headers from IN to OUT if it set OUT as result
and what not

Currently the SQL component has this flaw. In the past it was
Velocity. And I guess there are some other components as well.

Just starting a thread to not forget. I only had one cup of coffee
this morning. Going to boil water now.....


--
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Components setting data on OUT

Willem.Jiang
Administrator
Hi Claus

I agree the component should take responsible of copy the In message
headers into Out message headers. we could provides util class to do
that copy thing in camel-core.
But the component should also need to make sure some of the out message
header value which is copied from in message should be overrided
according components logical.

Such as the response context in camel-cxf component message header, it
should be overrided when the camel-cxf producer get the response from
actual web services.

Just my two cents,

Willem

Claus Ibsen wrote:

> Hi
>
> The OUT message really starts to irritate me.
>
> We have various components that set data on the OUT body and then the
> Pipeline will use this result as IN for then next node.
> What happens is then whatever headers etc from IN is lost. Then you
> cant really route and have your headers preserve during the entire
> route.
>
> We might wanna give this a thought in Camel 2.0?
> - Pipeline to always add headers from IN to OUT, so headers is preserved
> - Components to enforce MEP and only set data on OUT if its InOut
> - Components to add headers from IN to OUT if it set OUT as result
> and what not
>
> Currently the SQL component has this flaw. In the past it was
> Velocity. And I guess there are some other components as well.
>
> Just starting a thread to not forget. I only had one cup of coffee
> this morning. Going to boil water now.....
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Components setting data on OUT

William Tam
In reply to this post by Claus Ibsen-2
On Fri, Jan 23, 2009 at 12:55 AM, Claus Ibsen <[hidden email]> wrote:
> Hi
>
> The OUT message really starts to irritate me.
>
> We have various components that set data on the OUT body and then the
> Pipeline will use this result as IN for then next node.
> What happens is then whatever headers etc from IN is lost. Then you
> cant really route and have your headers preserve during the entire
> route.

I don't know t much about pipeline, but it sounds like pipeline should
do the copying if it is going to use one output message as input to
the next processor.  That it, the pipeline should copy both the body
and header (?)  The component does not know if the in header should be
copied to the out header.  Those in header may not be relevant to the
out body.  My intuition is that out header the header information
associated with the out message.  It (out header) does not have to
include everything in the in header.


>
> We might wanna give this a thought in Camel 2.0?
> - Pipeline to always add headers from IN to OUT, so headers is preserved

+1

> - Components to enforce MEP and only set data on OUT if its InOut

+1.

> - Components to add headers from IN to OUT if it set OUT as result
> and what not

Not sure.

>
> Currently the SQL component has this flaw. In the past it was
> Velocity. And I guess there are some other components as well.
>
> Just starting a thread to not forget. I only had one cup of coffee
> this morning. Going to boil water now.....
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Components setting data on OUT

William Tam
In reply to this post by Willem.Jiang
On Fri, Jan 23, 2009 at 2:33 AM, Willem Jiang <[hidden email]> wrote:

> Hi Claus
>
> I agree the component should take responsible of copy the In message
> headers into Out message headers. we could provides util class to do
> that copy thing in camel-core.
> But the component should also need to make sure some of the out message
> header value which is copied from in message should be overrided
> according components logical.
>
> Such as the response context in camel-cxf component message header, it
> should be overrided when the camel-cxf producer get the response from
> actual web services.
>

Hmm ... that means "Pipeline to always add headers from IN to OUT, so
headers is preserved"
could be problematic.   I guess, the pipeline needs to make sure it
does not overwrite headers that already exist in out header.  Still, I
think component may not want to get involved.


> Just my two cents,
>
> Willem
>
> Claus Ibsen wrote:
>> Hi
>>
>> The OUT message really starts to irritate me.
>>
>> We have various components that set data on the OUT body and then the
>> Pipeline will use this result as IN for then next node.
>> What happens is then whatever headers etc from IN is lost. Then you
>> cant really route and have your headers preserve during the entire
>> route.
>>
>> We might wanna give this a thought in Camel 2.0?
>> - Pipeline to always add headers from IN to OUT, so headers is preserved
>> - Components to enforce MEP and only set data on OUT if its InOut
>> - Components to add headers from IN to OUT if it set OUT as result
>> and what not
>>
>> Currently the SQL component has this flaw. In the past it was
>> Velocity. And I guess there are some other components as well.
>>
>> Just starting a thread to not forget. I only had one cup of coffee
>> this morning. Going to boil water now.....
>>
>>
>
>