You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marco Zapletal <ma...@gmail.com> on 2011/06/08 18:23:39 UTC

Using properties or headers to persist meta information on the exchange?

Hi,

I learned from this thread 
(http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html) 
that one should use properties instead of headers in order to durable 
store meta information on an exchange (acc. to one of the postings, 
headers can get lost at endpoints).

I would like to know whether this in principle correct. If so, I ran 
into the problem that properties seem to stripped away if an exchange 
goes through a JMS queue. Could anyone tell me what's the recommended 
approach to keep meta information durable on the exchange.

thanks,
marco

Re: Using properties or headers to persist meta information on the exchange?

Posted by Marco Zapletal <ma...@gmail.com>.
Claus, thanks for your response. yes, it is quite obvious that in such 
cases, the headers will be lost (which would be the case for properties, 
too). I was just a little bit confused about the distinction between 
headers and properties, after reading the thread I cited [1].

Anyway, I will stick to headers, which seem to work fine for me.

regards,
marco


On 09.06.2011 06:28, Claus Straube wrote:
> Marco, I think it depends on what you want to do. Of course there're
> components where you will loose message headers. Look at the file
> component, hazelcast:map or a database component. Of course you'll loose
> here the message headers, because they're bound to camel (where should
> you store them if put a file on disk? ...or an object into data grid?).
> If you need these information in your business context you have to
> implement this.
>
> On 08.06.2011 19:58, Marco Zapletal wrote:
>> Yes, I've read that. Actually, I just wanted to keep my (String)
>> properties when the exchange goes through the JMS queue (similar like
>> headers are kept over JMS queues).
>>
>> If it is the intended behavior that exchange properties are stripped
>> away by the JMS component, I am fine with using headers instead.
>> However, this contradicts then in my opinion to the discussion in [1],
>> where it is mentioned that exchange properties should be used for
>> durable storing (serializable) meta information on the exchange.
>>
>> --
>> The problem with the non-serializable MessageInfo (which violates the
>> JMS spec) occurs only if I set the transferExchange property on the
>> JMS component to true (which I tried only as a workaround).
>>
>> regards,
>> marco
>>
>> [1]
>> http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html
>>
>>
>>
>> On 08.06.2011 19:41, Claus Ibsen wrote:
>>> The JMS spec limits what can be send as JMS headers. Read more details
>>> on the Camel JMS wiki page. And for example in the JMS java doc.
>>>
>>>
>>> On Wed, Jun 8, 2011 at 6:36 PM, Marco
>>> Zapletal<ma...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> thanks for the quick response. Yes, I've tried this, but this opens up
>>>> another problem if you use a CXF endpoint on your route. The CXF
>>>> endpoint
>>>> seems to store an instance of
>>>> org.apache.cxf.service.model.MessageInfo on
>>>> the exchange, which is not serializable. This results in a runtime
>>>> exception, which cancels the execution of the process instance.
>>>>
>>>> regards,
>>>> marco
>>>>
>>>>
>>>> On 08.06.2011 18:26, Claus Straube wrote:
>>>>>
>>>>> Hi Marco,
>>>>>
>>>>> have you tried 'transferExchange=true' inside your JMS route? That
>>>>> could
>>>>> be a solution for your JMS problem.
>>>>>
>>>>> Best regards - Claus
>>>>>
>>>>> On 08.06.2011 18:23, Marco Zapletal wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I learned from this thread
>>>>>>
>>>>>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html)
>>>>>>
>>>>>> that one should use properties instead of headers in order to durable
>>>>>> store meta information on an exchange (acc. to one of the postings,
>>>>>> headers can get lost at endpoints).
>>>>>>
>>>>>> I would like to know whether this in principle correct. If so, I ran
>>>>>> into the problem that properties seem to stripped away if an exchange
>>>>>> goes through a JMS queue. Could anyone tell me what's the recommended
>>>>>> approach to keep meta information durable on the exchange.
>>>>>>
>>>>>> thanks,
>>>>>> marco
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>


Re: Using properties or headers to persist meta information on the exchange?

Posted by Claus Straube <cl...@catify.com>.
Marco, I think it depends on what you want to do. Of course there're 
components where you will loose message headers. Look at the file 
component, hazelcast:map or a database component. Of course you'll loose 
here the message headers, because they're bound to camel (where should 
you store them if put a file on disk? ...or an object into data grid?). 
If you need these information in your business context you have to 
implement this.

On 08.06.2011 19:58, Marco Zapletal wrote:
> Yes, I've read that. Actually, I just wanted to keep my (String) 
> properties when the exchange goes through the JMS queue (similar like 
> headers are kept over JMS queues).
>
> If it is the intended behavior that exchange properties are stripped 
> away by the JMS component, I am fine with using headers instead. 
> However, this contradicts then in my opinion to the discussion in [1], 
> where it is mentioned that exchange properties should be used for 
> durable storing (serializable) meta information on the exchange.
>
> -- 
> The problem with the non-serializable MessageInfo (which violates the 
> JMS spec) occurs only if I set the transferExchange property on the 
> JMS component to true (which I tried only as a workaround).
>
> regards,
> marco
>
> [1] 
> http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html
>
>
> On 08.06.2011 19:41, Claus Ibsen wrote:
>> The JMS spec limits what can be send as JMS headers. Read more details
>> on the Camel JMS wiki page. And for example in the JMS java doc.
>>
>>
>> On Wed, Jun 8, 2011 at 6:36 PM, Marco 
>> Zapletal<ma...@gmail.com>  wrote:
>>> Hi,
>>>
>>> thanks for the quick response. Yes, I've tried this, but this opens up
>>> another problem if you use a CXF endpoint on your route. The CXF 
>>> endpoint
>>> seems to store an instance of 
>>> org.apache.cxf.service.model.MessageInfo on
>>> the exchange, which is not serializable. This results in a runtime
>>> exception, which cancels the execution of the process instance.
>>>
>>> regards,
>>> marco
>>>
>>>
>>> On 08.06.2011 18:26, Claus Straube wrote:
>>>>
>>>> Hi Marco,
>>>>
>>>> have you tried 'transferExchange=true' inside your JMS route? That 
>>>> could
>>>> be a solution for your JMS problem.
>>>>
>>>> Best regards - Claus
>>>>
>>>> On 08.06.2011 18:23, Marco Zapletal wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I learned from this thread
>>>>>
>>>>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html) 
>>>>>
>>>>> that one should use properties instead of headers in order to durable
>>>>> store meta information on an exchange (acc. to one of the postings,
>>>>> headers can get lost at endpoints).
>>>>>
>>>>> I would like to know whether this in principle correct. If so, I ran
>>>>> into the problem that properties seem to stripped away if an exchange
>>>>> goes through a JMS queue. Could anyone tell me what's the recommended
>>>>> approach to keep meta information durable on the exchange.
>>>>>
>>>>> thanks,
>>>>> marco
>>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
>



Re: Using properties or headers to persist meta information on the exchange?

Posted by Marco Zapletal <ma...@gmail.com>.
Yes, I've read that. Actually, I just wanted to keep my (String) 
properties when the exchange goes through the JMS queue (similar like 
headers are kept over JMS queues).

If it is the intended behavior that exchange properties are stripped 
away by the JMS component, I am fine with using headers instead. 
However, this contradicts then in my opinion to the discussion in [1], 
where it is mentioned that exchange properties should be used for 
durable storing (serializable) meta information on the exchange.

--
The problem with the non-serializable MessageInfo (which violates the 
JMS spec) occurs only if I set the transferExchange property on the JMS 
component to true (which I tried only as a workaround).

regards,
marco

[1] 
http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html


On 08.06.2011 19:41, Claus Ibsen wrote:
> The JMS spec limits what can be send as JMS headers. Read more details
> on the Camel JMS wiki page. And for example in the JMS java doc.
>
>
> On Wed, Jun 8, 2011 at 6:36 PM, Marco Zapletal<ma...@gmail.com>  wrote:
>> Hi,
>>
>> thanks for the quick response. Yes, I've tried this, but this opens up
>> another problem if you use a CXF endpoint on your route. The CXF endpoint
>> seems to store an instance of org.apache.cxf.service.model.MessageInfo on
>> the exchange, which is not serializable. This results in a runtime
>> exception, which cancels the execution of the process instance.
>>
>> regards,
>> marco
>>
>>
>> On 08.06.2011 18:26, Claus Straube wrote:
>>>
>>> Hi Marco,
>>>
>>> have you tried 'transferExchange=true' inside your JMS route? That could
>>> be a solution for your JMS problem.
>>>
>>> Best regards - Claus
>>>
>>> On 08.06.2011 18:23, Marco Zapletal wrote:
>>>>
>>>> Hi,
>>>>
>>>> I learned from this thread
>>>>
>>>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html)
>>>> that one should use properties instead of headers in order to durable
>>>> store meta information on an exchange (acc. to one of the postings,
>>>> headers can get lost at endpoints).
>>>>
>>>> I would like to know whether this in principle correct. If so, I ran
>>>> into the problem that properties seem to stripped away if an exchange
>>>> goes through a JMS queue. Could anyone tell me what's the recommended
>>>> approach to keep meta information durable on the exchange.
>>>>
>>>> thanks,
>>>> marco
>>>>
>>>
>>
>>
>
>
>


RE: Using properties or headers to persist meta information on the exchange?

Posted by "Klug, Johannes" <jo...@logica.com>.
Does that mean you can't count on your custom Camel message headers to
survive a transition to JMS?

> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: 08 June 2011 19:41
> To: users@camel.apache.org
> Subject: Re: Using properties or headers to persist meta information
on
> the exchange?
> 
> The JMS spec limits what can be send as JMS headers. Read more details
> on the Camel JMS wiki page. And for example in the JMS java doc.
> 
> 
> On Wed, Jun 8, 2011 at 6:36 PM, Marco Zapletal
> <ma...@gmail.com> wrote:
> > Hi,
> >
> > thanks for the quick response. Yes, I've tried this, but this opens
> up
> > another problem if you use a CXF endpoint on your route. The CXF
> endpoint
> > seems to store an instance of
> org.apache.cxf.service.model.MessageInfo on
> > the exchange, which is not serializable. This results in a runtime
> > exception, which cancels the execution of the process instance.
> >
> > regards,
> > marco
> >
> >
> > On 08.06.2011 18:26, Claus Straube wrote:
> >>
> >> Hi Marco,
> >>
> >> have you tried 'transferExchange=true' inside your JMS route? That
> could
> >> be a solution for your JMS problem.
> >>
> >> Best regards - Claus
> >>
> >> On 08.06.2011 18:23, Marco Zapletal wrote:
> >>>
> >>> Hi,
> >>>
> >>> I learned from this thread
> >>>
> >>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-
> live-in-routes-td474477.html)
> >>> that one should use properties instead of headers in order to
> durable
> >>> store meta information on an exchange (acc. to one of the
postings,
> >>> headers can get lost at endpoints).
> >>>
> >>> I would like to know whether this in principle correct. If so, I
> ran
> >>> into the problem that properties seem to stripped away if an
> exchange
> >>> goes through a JMS queue. Could anyone tell me what's the
> recommended
> >>> approach to keep meta information durable on the exchange.
> >>>
> >>> thanks,
> >>> marco
> >>>
> >>
> >
> >
> 
> 
> 
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



Re: Using properties or headers to persist meta information on the exchange?

Posted by Claus Ibsen <cl...@gmail.com>.
The JMS spec limits what can be send as JMS headers. Read more details
on the Camel JMS wiki page. And for example in the JMS java doc.


On Wed, Jun 8, 2011 at 6:36 PM, Marco Zapletal <ma...@gmail.com> wrote:
> Hi,
>
> thanks for the quick response. Yes, I've tried this, but this opens up
> another problem if you use a CXF endpoint on your route. The CXF endpoint
> seems to store an instance of org.apache.cxf.service.model.MessageInfo on
> the exchange, which is not serializable. This results in a runtime
> exception, which cancels the execution of the process instance.
>
> regards,
> marco
>
>
> On 08.06.2011 18:26, Claus Straube wrote:
>>
>> Hi Marco,
>>
>> have you tried 'transferExchange=true' inside your JMS route? That could
>> be a solution for your JMS problem.
>>
>> Best regards - Claus
>>
>> On 08.06.2011 18:23, Marco Zapletal wrote:
>>>
>>> Hi,
>>>
>>> I learned from this thread
>>>
>>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html)
>>> that one should use properties instead of headers in order to durable
>>> store meta information on an exchange (acc. to one of the postings,
>>> headers can get lost at endpoints).
>>>
>>> I would like to know whether this in principle correct. If so, I ran
>>> into the problem that properties seem to stripped away if an exchange
>>> goes through a JMS queue. Could anyone tell me what's the recommended
>>> approach to keep meta information durable on the exchange.
>>>
>>> thanks,
>>> marco
>>>
>>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Using properties or headers to persist meta information on the exchange?

Posted by Marco Zapletal <ma...@gmail.com>.
Hi,

thanks for the quick response. Yes, I've tried this, but this opens up 
another problem if you use a CXF endpoint on your route. The CXF 
endpoint seems to store an instance of 
org.apache.cxf.service.model.MessageInfo on the exchange, which is not 
serializable. This results in a runtime exception, which cancels the 
execution of the process instance.

regards,
marco


On 08.06.2011 18:26, Claus Straube wrote:
> Hi Marco,
>
> have you tried 'transferExchange=true' inside your JMS route? That could
> be a solution for your JMS problem.
>
> Best regards - Claus
>
> On 08.06.2011 18:23, Marco Zapletal wrote:
>> Hi,
>>
>> I learned from this thread
>> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html)
>> that one should use properties instead of headers in order to durable
>> store meta information on an exchange (acc. to one of the postings,
>> headers can get lost at endpoints).
>>
>> I would like to know whether this in principle correct. If so, I ran
>> into the problem that properties seem to stripped away if an exchange
>> goes through a JMS queue. Could anyone tell me what's the recommended
>> approach to keep meta information durable on the exchange.
>>
>> thanks,
>> marco
>>
>


Re: Using properties or headers to persist meta information on the exchange?

Posted by Claus Straube <cl...@catify.com>.
Hi Marco,

have you tried 'transferExchange=true' inside your JMS route? That could 
be a solution for your JMS problem.

Best regards - Claus

On 08.06.2011 18:23, Marco Zapletal wrote:
> Hi,
>
> I learned from this thread 
> (http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-td474477.html) 
> that one should use properties instead of headers in order to durable 
> store meta information on an exchange (acc. to one of the postings, 
> headers can get lost at endpoints).
>
> I would like to know whether this in principle correct. If so, I ran 
> into the problem that properties seem to stripped away if an exchange 
> goes through a JMS queue. Could anyone tell me what's the recommended 
> approach to keep meta information durable on the exchange.
>
> thanks,
> marco
>