camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Am I using headers right?
Date Wed, 25 Nov 2015 15:00:01 GMT
Properties get lost even more often than headers, though. They're only
copied when the entire Exchange is used instead of the message body or the
Message object. I use them for temporary metadata between Processors,
beans, etc.

On 25 November 2015 at 06:54, Joakim Bjørnstad <joakibj@gmail.com> wrote:

> Hello,
>
> If you need metadata or a value on multiple endpoints, or to be used
> internally in your routes, it is better to put them in the
> exchangeProperties. Then copy them out to headers, when needed. Since
> headers are meant to be used at the protocol/component in/out, there
> is no guarantee they persist or be unchanged when the message returns.
> Also reduces unwanted metadata leaking out of your routes, for example
> to JMS, HTTP/SOAP as you mentioned.
>
>
>
> On Wed, Nov 25, 2015 at 12:52 AM, Matt Sicker <boards@gmail.com> wrote:
> > I filter out what headers to send when making REST calls through http4
> for
> > instance, so that's not an issue. When I make internal calls to networked
> > services (e.g., Kafka, Hazelcast, or pretty much anything other than the
> > message brokering components), I lose all my headers until the response
> > message is handled (and only some components save those headers).
> >
> > On 24 November 2015 at 16:36, ychawla <premiergeneration@gmail.com>
> wrote:
> >
> >> That sounds sensible to me.  The headers are for message and exchange
> >> metadata.  Just be careful to not send them over the wire when you call
> an
> >> external component.
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Am-I-using-headers-right-tp5774363p5774365.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > Matt Sicker <boards@gmail.com>
>
>
>
> --
> Kind regards
> Joakim Bjørnstad
>



-- 
Matt Sicker <boards@gmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message