camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <brad.john...@mediadriver.com>
Subject Re: Is it possible to make a message header or property immutable?
Date Tue, 05 Jul 2016 18:01:12 GMT
Is there another part of your process that is specifically changing the
header or are you more concerned about it being consistently there across
routes?  Nothing will change it automatically if it is your header.  I
don't remember the actual implementation but conceptually it is just a
hastable/map with key/values.  If you set header with some specific key
then nothing else will change it.

As an example, I use a camel splitter and then set a header with the
splitter index so that I can use it in another route later to reassemble
with the resequencer.

<split>
<simple>${body}</simple>
<setHeader headerName="seqnum">
<simple>exchangeProperty.CamelSplitIndex</simple>
</setHeader>
...

The "seqnum" is just a key that I'm defining.  I could obviously call it
anything "sequenceNumber" or whatever but when I access it later that
header is available on the exchange. If I explicitly change what the map is
storing for "seqnum" then it will be different because I can't make the
header map itself immutable.


On Tue, Jul 5, 2016 at 10:33 AM, Matt Sicker <boards@gmail.com> wrote:

> As in once I set the header, nothing can change the header during the
> lifecycle of the message during a route. Same for an exchange property.
>
> --
> Matt Sicker <boards@gmail.com>
>

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