Jakub Scholz created QPIDJMS-48:
-----------------------------------
Summary: Handling of properties with "." in their name
Key: QPIDJMS-48
URL: https://issues.apache.org/jira/browse/QPIDJMS-48
Project: Qpid JMS
Issue Type: Bug
Components: qpid-jms-client
Affects Versions: 0.1.0
Reporter: Jakub Scholz
The Qpid C++ broker - which supports both AMQP 0.10 and 1.0 - delivers quite
often messages with a property containing "." in the property name. In
particular, the property "qpid.subject" can be seen quite often, because it is
attached automatically to the message by some AMQP 0.10 clients.
The current handling of message properties with "." in their name seems to be a
bit strange in the Qpid JMS client. When the client receives a message with
this property, its property name is returned by the method getPropertyNames()
including the dot. However, when I try to call some method to actually get the
property value - e.g. getStringProperty("qpid.subject"), I get an exception:
javax.jms.JMSException: Identifier contains invalid JMS identifier character
'.': 'qpid.subject'
at
org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:77)
at org.apache.qpid.jms.JmsConnection.onException(JmsConnection.java:481)
at
org.apache.qpid.jms.JmsMessageConsumer$MessageDeliverTask.run(JmsMessageConsumer.java:602)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Identifier contains invalid JMS
identifier character '.': 'qpid.subject'
at
org.apache.qpid.jms.message.JmsMessage.checkIdentifierLetterAndDigitRequirements(JmsMessage.java:568)
at
org.apache.qpid.jms.message.JmsMessage.checkIdentifierFormat(JmsMessage.java:531)
at
org.apache.qpid.jms.message.JmsMessage.checkPropertyNameIsValid(JmsMessage.java:527)
at
org.apache.qpid.jms.message.JmsMessage.getObjectProperty(JmsMessage.java:296)
at
org.apache.qpid.jms.message.JmsMessage.getStringProperty(JmsMessage.java:393)
at cz.scholz.amqp10.jms.Listener.onMessage(Listener.java:72)
at
org.apache.qpid.jms.JmsMessageConsumer$MessageDeliverTask.run(JmsMessageConsumer.java:592)
... 3 more
This causes problems when you client wants to iterate over all message
properties and I think the behavior should be more consistent. If the property
is returned by getPropertyNames(), then the get*Property() should work too. Or
other way around - if get*Property cannot be used for such property, it should
not be returned in getPropertyNames().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]