camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: DefaultUnitOfWork doesn't copy headers from the original message if it's a JmsMessage
Date Tue, 28 Feb 2012 08:02:07 GMT

Yeah the headers can most likely be copied today if the JMS brokers do
not barf anymore.

However I had hoped in the mean time we had fixed this and released
Camel 3.0, where we can optimize the logic
to only copy on demand. I once had some experimental code for this to
check the routes if the useOriginalMessage option was enabled or not.
And thus only do the copy if needed. Currently the logic is *always*
doing a defensive copy, even if the useOriginalMessage is not enabled.

As well for JmsMessage when we do a copy it will have to access the
JMS API to gather the JMS headers and whatnot.
And for people who do straight through messaging, this is really not needed.

Anyway I think for Camel 2.10 we can possible copy the headers as well
for JMS, if there is no issues.
I would like to test this with other JMS brokers than AMQ, if possible.
For older releases such as 2.9.x and below, I would keep current
behavior to not introduce side-effects for people using Camel in

On Mon, Feb 27, 2012 at 2:18 PM, Babak Vahdat
<> wrote:
> Hi Christian,
> I did verify it as well and indeed copying headers would also work even if
> we deal with JmsMessage as well. However I've got no idea about the comment:
> // cannot copy headers with a JmsMessage as the underlying javax.jms.Message
> object goes nuts
> Which came across the revision [1]. My assumption is that it used to cause
> problems to copy the jms headers in old days of ActiveMQ (2009) so why this
> comment.
> However what I also don't get is that according to [2] the JMS specification
> states that header names must be valid Java identifiers, but ActiveMQ
> (5.5.1) seems to allow even non valid Java Identifiers as header name! I
> tried with "%" which is not a valid Java Identifier:
> javax.lang.model.SourceVersion.RELEASE_6.isIdentifier("%");
> And the test still passed:
> mockResult.expectedHeaderReceived("%", "header-value");
> I hope Claus can help us regarding this question. BTW just in case you get
> some spare time would you please take a look at [3] as well?
> Thanks.
> [1]
> [2]
> [3]
> Babak
> --
> View this message in context:
> Sent from the Camel Development mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message