You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (JIRA)" <ji...@apache.org> on 2011/03/22 04:02:05 UTC

[jira] [Commented] (QPID-2930) JMS msg.getPropertyNames() method should not return x-amqp-0-10.routing-key

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

Rajith Attapattu commented on QPID-2930:
----------------------------------------

Andrew, 

I had modified the test case for testing/debugging another issue and forgot to reapply the deleted contents before checking it in.
Thanks for catching this. I have reapplied the necessary changes in rev 1084048 which should test the issue highlighted in the JIRA.

As for documentation for set/getObjectProperty as an extension point, I haven't really seen any that says we support byte arrays in addition to the supported types listed in the spec.

I don't know if filtering out x-amqp* and x-qpid* is the right option, especially if those properties are of a type supported by the JMS spec and some application wants to access them. On the other hand one can argue that these props are for internal purposes and not for applications.

The reason why I omitted "x-amqp-0-10.routing-key" from the enumerated prop name list, is bcos it's value was not a supported JMS type. The user who complained about this issue has rightly pointed out that any property in a message should be accessible as 'getStringProperty'.

So if we do decide to use set/getObjectProperty as an extension point then we need to ensure we handle it in a sensible manner and in a way that is also spec complaint. That is if getStringProperty is used to retrieve such a property then we need to provide,
(a) some form of meaningful string representation
(b) OR a warning message on how to retrieve it properly rather than throwing an exception. Ex "<list> please use getObjectProperty to retrieve this value correctly"
(c) Or maybe by throwing a MessageFormatException, all though in this case the user wasn't happy about it. - However if we had documented the behaviour then I doubt they would have complained about it.

So going we probably need to pay attention to these areas and make sure we document them properly to avoid users misunderstanding them.




>  JMS msg.getPropertyNames() method should not return x-amqp-0-10.routing-key
> ----------------------------------------------------------------------------
>
>                 Key: QPID-2930
>                 URL: https://issues.apache.org/jira/browse/QPID-2930
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>            Priority: Minor
>             Fix For: 0.10
>
>
> Description of problem:
> JMS msg.getPropertyNames() method should not return x-amqp-0-10.routing-key,
> x-amqp-0-10.routing-key is internal property. It cause exception if loop via
> ProertyName enumeration. 
> Code: 
> === 
> Enumeration<String> enu = msg.getPropertyNames(); 
> while (enu.hasMoreElements()) { 
> String name = (String) enu.nextElement(); 
> String value = msg.getStringProperty(name); 
> } 
> Exception
> =========
> Caused by: javax.jms.MessageFormatException:
> getString("x-amqp-0-10.routing-key") failed as value of type class [B is an array. 
> at
> org.apache.qpid.client.message.AMQMessageDelegate_0_10.getStringProperty(AMQMessageDelegate_0_10.java:639) 
> at
> org.apache.qpid.client.message.AbstractJMSMessage.getStringProperty(AbstractJMSMessage.java:254) 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org