Is there any best practice as to what to use message headers for? I
asked this a few weeks ago on this list but only got one response.

In our project, we were discussing whether to put meta-data like name,
description, timestamp, message source, and others into header fields.

The one reply I got last time suggested to create a custom class for our
purpose and put the meta-data into fields, along with the message body.

What are the downsides of using Camel message headers?
Are they not guaranteed to be kept intact while en route?

Cheers,
Johannes

> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: 18 May 2011 12:15
> To: users@camel.apache.org
> Subject: Re: camel message headers
> 
> Yep you can store anything you like. The type is java.lang.Object.
> 
> If you use the DSL you can do
> 
> .setHeader("myHeader", constant(new MyObject())). ...
> 
> 
> On Wed, May 18, 2011 at 12:10 PM, tnk <jus...@gmail.com> wrote:
> > Hi,
> >
> > what values can be stored in message headers (using camel 2.6)?
> > Is it restricted only to String values (like setHeader("MY_HEADER",
> "string
> > value"))?
> > Can I store any Java object (serializable) in message header
> > (setHeader("MY_HEADER", new MyNewObject()) )
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/camel-message-headers-
> tp4406101p4406101.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> 
> 
> 
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> CamelOne 2011: http://fusesource.com/camelone2011/
> 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.


Reply via email to