qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: qpid-send and --properties possible bug/compatibility problem?
Date Fri, 13 Jun 2014 10:13:42 GMT
On 06/12/2014 03:06 PM, Jan Bares wrote:
> Hi,
> property passed with message like that:
> qpid-send -b ${BROKER} -a exchange/cal --durable yes --content-string "content" --property
> will throw MessageFormatException in getStringProperty() in Java JMS client. The class
of value is array of bytes instead of String.
> javax.jms.MessageFormatException: getString("WoodFileName") failed as value of type class
[B is an array.
>          at org.apache.qpid.client.message.AMQMessageDelegate_0_10.getStringProperty(AMQMessageDelegate_0_10.java:753)
>          at org.apache.qpid.client.message.AbstractJMSMessage.getStringProperty(AbstractJMSMessage.java:225)
>          at com.wood.engine.messages.InboundMessageEngine$MtiMessageListener.onMessage(InboundMessageEngine.java:900)
>          at com.wood.util.jms.MessageListenerBatchAck.runImpl(MessageListenerBatchAck.java:112)
>          at com.wood.util.jms.MessageListenerBatchAck.run(MessageListenerBatchAck.java:85)
>          at java.lang.Thread.run(Thread.java:745)
> qpid-send as of QPID 0.18, C++ broker 0.18, Java JMS client 0.18. It seems the problem
is in qpid-send because message properties passed from .NET are read as Strings in Java.

That's an issue with qpid-send, which doesn't set the string properties 
to be utf8 encoded, meaning they get transferred as binary which is then 
converted to a byte[] in Java.

I'll check in a fix for that shortly 

Note you can avoid the issue by explicitly setting the encoding of the 
property sent in c++ to "utf8" in the application. (See for example the 
fix to drain that was committed already: 

To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org

View raw message