You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by fadams <fr...@blueyonder.co.uk> on 2011/07/22 20:20:53 UTC

Getting QMF2 "qmf.opcode" in JMS seems to vary between a String and byte[]

OK this one is weird....

As I'm exploring QMF2 in JMS I've been playing with getting Agent
information

I've got code as follows:

String agent = message.getStringProperty("qmf.agent");
String opcode = message.getStringProperty("qmf.opcode");

Which works perfectly for the Broker Agent, but when I tried firing up the
example agent in qpid-0.10/cpp/bindings/qmf2/examples/cpp I get exceptions:

javax.jms.MessageFormatException: getString("qmf.opcode") failed as value of
type class [B is an array.

I wonder if this is related to the posting "c++ 0.10 client, java 0.10
broker, headers exchange not routing "

The answer there was:


Try adding a line after that something like the following:

   msg.getProperties()["xyz_header"].setEncoding("utf8"); 


But clearly in my case this is in the Agent (or more likely the broker)
code.

Is there anything I can do on my Java JMS side to get things to behave
consistently - or do I have to resort to checking the property type and if
it's a byte[] construct a new String from the byte[]

I'd appreciate thoughts

Cheers,
Frase
















--
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/Getting-QMF2-qmf-opcode-in-JMS-seems-to-vary-between-a-String-and-byte-tp6611387p6611387.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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