Hi Its documented on the Camel JMS page about the JMS spec limitations on header keys / header value types etc http://camel.apache.org/jms
Also see the option jmsKeyFormatStrategy where you can provide a custom strategy On Wed, Aug 1, 2012 at 4:59 PM, Ignat <izapol...@gmail.com> wrote: > Hello, > > I think I've run into certain issue with camel - normally it allows almost > any header names, but JMS spec is quite restrictive about it (taken from JMS > 1.1 3.8.1.1 paragraph, page 42): > > Identifiers: > - An identifier is an unlimited-length character sequence that must begin > with a Java identifier start character; all following characters must be > Java identifier part characters. An identifier start character is any > character for which the method Character.isJavaIdentifierStart returns true. > This includes ‘_’ and ‘$’. An identifier part character is any character for > which the method Character.isJavaIdentifierPart returns true. > - Identifiers cannot be the names NULL, TRUE, or FALSE. > ..... (formal naming rules about reserved identifiers are skipped) ... > > So, for example, Foo://Bar&baz is valid header for using within camel route, > but it won't pass JMS provider validation for identifier correctness. > > This issue is hidden in Camel to certain degree, since identifiers like > foo-bar will be auto-magically transformed into foo_HYPEN_bar, but this > transformation does not affect whole range of possible values. > > My current workaround is to actually strip all message's headers that do not > conform to quoted spec, but some policy of auto-magical header's > transformation (from incoming messages and for outgoing messages) could be > potentially useful. > > For some reason I cannot find any code in camel trunk that ignores header > names that are not conforming to be java identifiers (looked into > https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java > shouldOutputHeader and > https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java > and DefaultHeaderFilterStrategy) so I presume this is just an oversight. > > Also current behaviour contradicts to http://camel.apache.org/jms.html > Message Header Mapping wiki section. > > Thanks. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Issue-with-JMS-endpoint-headers-that-do-not-conform-to-JMS-spec-tp5716665.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen