[ 
https://issues.apache.org/jira/browse/QPIDJMS-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14579224#comment-14579224
 ] 

ASF subversion and git services commented on QPIDJMS-48:
--------------------------------------------------------

Commit e9d752a048ea984fc5ea750a23c539fcb7a12b65 in qpid-jms's branch 
refs/heads/master from Robert Gemmell
[ https://git-wip-us.apache.org/repos/asf?p=qpid-jms.git;h=e9d752a ]

QPIDJMS-48: wire up connection option for toggling behaviour, add some 
integration test to verify new and received messages both pick it up


> inconsistent handling of property names in Message methods
> ----------------------------------------------------------
>
>                 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, 0.2.0
>            Reporter: Jakub Scholz
>            Assignee: Robbie Gemmell
>             Fix For: 0.3.0
>
>
> The client validates the values passed to get/Set*Property methods, enforcing 
> that they are valid Java identifier names. It does not however validate the 
> values returned from/given to the getPropertyNames or propertyExists methods, 
> meaning it could return (or indicate presence) of properties that dont meet 
> the JMS requirements, but then fail to allow setting/accessing them.
> The behaviour of getPropertyNames or propertyExists should be updated to 
> match the validating behaviour of the get/Set*Property methods. An option 
> will be added to enable disabling the validation.
> Original Text:
> 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]

Reply via email to