camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Some headers are not forwarded to JMS destinations
Date Fri, 18 Apr 2008 13:33:40 GMT
On 18/04/2008, Carlos Quiroz <> wrote:
>  Hi
>  I have been doing a system where certain messages are received in activemq,
>  processed somehow (In particular I add my own custom headers) and then
>  forward them to another queue.
>  I noticed that my headers which had the format X-HEADER... were not
>  forwarded and finally I found that JmsBinding has a function that filter
>  headers so that only headers which form a valid Java identifier are
>  forwarded:
>         protected boolean shouldOutputHeader(org.apache.camel.Message camelMessage,
>  String headerName,
>                                                                                  Object
headerValue) {
>                 return headerValue != null && !getIgnoreJmsHeaders().contains(headerName)
>                            && ObjectHelper.isJavaIdentifier(headerName);
>         }
>  I wonder what is the rationale for this?

The rational is that the JMS spec says only headers which are valid
JMS identifiers are allowed. So the JMS provider could well barf if
you use an invalid identifier (and some do - which is why we put this
code in).

Though ActiveMQ really doesn't much care, under the covers what the
header is; so we could make this restriction optional if you like.
Though only valid identifiers are allowed in SQL selector statements
(which is the main reason the JMS spec specifies the identifier rule)
- so for JMS I guess its good practice to stick to identifier names


Open Source Integration

View raw message