[
https://issues.apache.org/jira/browse/ARTEMIS-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17097604#comment-17097604
]
Justin Bertram edited comment on ARTEMIS-2700 at 5/1/20, 6:58 PM:
------------------------------------------------------------------
JMS property names must be valid Java identifiers which is why hyphen
characters (i.e. {{-}}) are not allowed. Specifically, section 3.5.1 of the JMS
1.1 specification states:
bq. Property names must obey the rules for a message selector identifier. See
Section 3.8.1.1, “Message Selector Syntax,” for more information.
Section 3.8.1.1 states (in part):
bq. 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.
Therefore, you'll need to perform translation for your property names before
setting them.
was (Author: jbertram):
JMS property names must be valid Java identifiers which is why hyphen
characters (i.e. {{-}}) are not allowed. Specifically, section 3.5.1 of the JMS
1.1 specification states:
bq. Property names must obey the rules for a message selector identifier. See
Section 3.8.1.1, “Message Selector Syntax,” for more information.
Section 3.8.1.1 states (in part):
bq. 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.
Therefore, you'll need to perform translation for your property names before
setting them.
> Avoid checking java identified for jms attributes :: AMQ139012
> --------------------------------------------------------------
>
> Key: ARTEMIS-2700
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2700
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.9.0, 2.10.0, 2.10.1, 2.11.0
> Reporter: Eathi Rajulu
> Priority: Major
>
> Hi Team,
>
> We are using Web application http header & JMS properties
> transformations/exchange.
>
> *Web to JMS :* x-header-id should be passed to jms attribute as x-header-id
> *JMS to Web :* jms attribute x-property-id passed to web as x-property-id
>
> We came across one issue related to java identifier checking in
> (checkPropperty method)
> [https://github.com/apache/activemq-artemis/blob/master/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java]
>
> When we verified the same with activemq, we don't have such restrictions
> [https://github.com/apache/activemq/blob/master/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java]
>
> In case of Web application level all custom headers can be prefixed with X-,
> so we started using -(hyphen)
>
> Can we fix checking this java identifier property in apache artemis side.
>
> *Error we are getting as :*
> java.lang.IllegalArgumentException: The property name 'x-header-id' is not a
> valid java identifier.
> {{}}
>
> Thanks,
> Raju
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)