Robert Greig wrote:
I agree that interop is a key principle and very important. However in
the case of 0.8 which, when you get into the detail of features
required for JMS or even just "useful functionality" and realise that
0.8 has many limitations, I think it's reasonable to break interop as
long as we push the changes into AMQP.
I agree 0-8 has many limitations (some, like richer types are still
there in 0-9). Again, I'm not at all opposed to addressing these with
non-standard features, but I would be keen to explore whether these can
be provided in such a way as to allow basic functionality to remain
interoperable while allowing users to sacrifice that interoperability
where the more advanced features are needed.
Yes I completely agree, and accept that we (mostly me) have not done a
particularly good job of publicising the breaking changes. Hopefully
now that AMQP is improving its process, it will be easier to follow
through on these.
No criticism of individuals was in any way intended when I made my
comments in JIRA or in the subsequent email thread. My aim was merely to
highlight the issue at hand which led into a brief diversion on approach
that we seem to be in agreement on.
Using 'long strings' only as per your suggestion allows the java clients
to at least get through connection with the c++ broker at present (see
attached patch; not sure if this will have an impact on JMS compliance).
However the topic test still doesn't complete due to use of other
non-standard types (in particular the 'binary' type, though I need to do
some more investigation into this as the topic test code itself does not
seem to set any message properties).
Index: common/src/main/java/org/apache/qpid/framing/FieldTable.java
===================================================================
--- common/src/main/java/org/apache/qpid/framing/FieldTable.java (revision 496618)
+++ common/src/main/java/org/apache/qpid/framing/FieldTable.java (working copy)
@@ -277,7 +277,8 @@
public String getString(AMQShortString string)
{
AMQTypedValue value = getProperty(string);
- if ((value != null) && ((value.getType() == AMQType.WIDE_STRING) ||
+ if ((value != null) && ((value.getType() == AMQType.LONG_STRING) ||
+ (value.getType() == AMQType.WIDE_STRING) ||
(value.getType() == AMQType.ASCII_STRING)))
{
return (String) value.getValue();
@@ -460,15 +461,10 @@
}
else
{
- //FIXME: determine string encoding and set either WIDE or ASCII string
-// if ()
- {
- return setProperty(string, AMQType.WIDE_STRING.asTypedValue(value));
- }
-// else
-// {
-// return setProperty(string, AMQType.ASCII_STRING.asTypedValue(value));
-// }
+ //For compatability with AMQP, always use LONG_STRING for
+ //now. This may change if the set of types standardised in
+ //AMQP is extended to include other types of strings
+ return setProperty(string, AMQType.LONG_STRING.asTypedValue(value));
}
}
Index: client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
===================================================================
--- client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java (revision 496618)
+++ client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java (working copy)
@@ -118,10 +118,10 @@
stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
FieldTable clientProperties = FieldTableFactory.newFieldTable();
- clientProperties.setAsciiString(new AMQShortString(ClientProperties.instance.toString()), protocolSession.getClientID());
- clientProperties.setAsciiString(new AMQShortString(ClientProperties.product.toString()), QpidProperties.getProductName());
- clientProperties.setAsciiString(new AMQShortString(ClientProperties.version.toString()), QpidProperties.getReleaseVersion());
- clientProperties.setAsciiString(new AMQShortString(ClientProperties.platform.toString()), getFullSystemInfo());
+ clientProperties.setString(new AMQShortString(ClientProperties.instance.toString()), protocolSession.getClientID());
+ clientProperties.setString(new AMQShortString(ClientProperties.product.toString()), QpidProperties.getProductName());
+ clientProperties.setString(new AMQShortString(ClientProperties.version.toString()), QpidProperties.getReleaseVersion());
+ clientProperties.setString(new AMQShortString(ClientProperties.platform.toString()), getFullSystemInfo());
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.