qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fadams <fraser.ad...@blueyonder.co.uk>
Subject Re: c++ 0.10 client, java 0.10 broker, headers exchange not routing
Date Sat, 23 Jul 2011 07:46:31 GMT

Gordon Sim wrote:
> Try adding a line after that something like the following:
>    msg.getProperties()["xyz_header"].setEncoding("utf8");

Is there a reason that this isn't the default behaviour - it would seem to
make sense from a Java/C++ interoperability perspective and it's not ideal
to have to rely on a client doing something that might perhaps be seen as a
bit esoteric. In other words relying on client code rather than client
runtime for interoperability is an unsafe principle.

This inconsistency seems to happen all over the place. For example I've just
been bitten with qmf.opcode and qmf.agent Message properties being returned
as byte[] - annoyingly they *mostly* get returned as String (from the broker
agent), but when I fired up a different agent they got returned as byte[].
This kind of breaks the JMS spec which says "The getObjectProperty method
only returns values of class Boolean, Byte, Short, Integer, Long, Float,
Double, and String. "

In addition every string property in QMF2 from the broker agent gets
returned as a byte[]. I've got around this by having a getStringValue method
that does

	public String getStringValue(String name) {
		return hasValue(name) ? new String((byte[])getValue(name)) : "";

But I'm thinking even that's not safe as I bet if I wrote a Java Agent the
string would be a "real" String so I'm going to have to "instanceof" which
kind of upsets me :-)


View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/c-0-10-client-java-0-10-broker-headers-exchange-not-routing-tp6597256p6613162.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

View raw message