diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-01-28 02:05:18 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-01-28 02:05:18 +0000 |
commit | ced42b83b5bcc435db7163a06f6992162b958009 (patch) | |
tree | 454fc27ce5387218478b0bc3bc34ccb3bc9c3134 | |
parent | 1b680b84389cfdc5873e7fcc7bf41e8e06355304 (diff) | |
download | qpid-python-ced42b83b5bcc435db7163a06f6992162b958009.tar.gz |
This is related to QPID-2363
I added use_legacy_map_msg_format as a connection paramter to force the client to use the old map message format.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@903940 13f79535-47bb-0310-9956-ffa450edef68
4 files changed, 27 insertions, 4 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java index cdf1167185..d6f91daae0 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java @@ -323,6 +323,10 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect //Indicates the sync publish options (persistent|all) //By default it's async publish private String _syncPublish = ""; + + // Indicates whether to use the old map message format or the + // new amqp-0-10 encoded format. + private boolean _useLegacyMapMessageFormat; /** * @param broker brokerdetails @@ -452,7 +456,18 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect // use the default value set for all connections _syncPublish = System.getProperty((ClientProperties.SYNC_ACK_PROP_NAME),_syncPublish); } - + + if (connectionURL.getOption(ConnectionURL.OPTIONS_USE_LEGACY_MAP_MESSAGE_FORMAT) != null) + { + _useLegacyMapMessageFormat = Boolean.parseBoolean( + connectionURL.getOption(ConnectionURL.OPTIONS_USE_LEGACY_MAP_MESSAGE_FORMAT)); + } + else + { + // use the default value set for all connections + _useLegacyMapMessageFormat = Boolean.getBoolean(ClientProperties.USE_LEGACY_MAP_MESSAGE_FORMAT); + } + String amqpVersion = System.getProperty((ClientProperties.AMQP_VERSION), "0-10"); _failoverPolicy = new FailoverPolicy(connectionURL, this); @@ -1607,4 +1622,9 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect { return _sessions.getNextChannelId(); } + + public boolean isUseLegacyMapMessageFormat() + { + return _useLegacyMapMessageFormat; + } } diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index 2f9ddd81ad..5946d9096e 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -227,7 +227,7 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic protected final boolean DECLARE_EXCHANGES = Boolean.parseBoolean(System.getProperty("qpid.declare_exchanges", "true")); - protected boolean USE_AMQP_ENCODED_MAP_MESSAGE = !Boolean.getBoolean("qpid.use_legacy_map_message"); + protected final boolean USE_AMQP_ENCODED_MAP_MESSAGE; /** System property to enable strict AMQP compliance. */ public static final String STRICT_AMQP = "STRICT_AMQP"; @@ -425,7 +425,7 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic protected AMQSession(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode, MessageFactoryRegistry messageFactoryRegistry, int defaultPrefetchHighMark, int defaultPrefetchLowMark) { - + USE_AMQP_ENCODED_MAP_MESSAGE = !con.isUseLegacyMapMessageFormat(); _strictAMQP = Boolean.parseBoolean(System.getProperties().getProperty(STRICT_AMQP, STRICT_AMQP_DEFAULT)); _strictAMQPFATAL = Boolean.parseBoolean(System.getProperties().getProperty(STRICT_AMQP_FATAL, STRICT_AMQP_FATAL_DEFAULT)); diff --git a/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java b/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java index 6590002bf1..0e8ca60686 100644 --- a/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java +++ b/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java @@ -38,6 +38,7 @@ public interface ConnectionURL public static final String OPTIONS_MAXPREFETCH = "maxprefetch"; public static final String OPTIONS_SYNC_ACK = "sync_ack"; public static final String OPTIONS_SYNC_PUBLISH = "sync_publish"; + public static final String OPTIONS_USE_LEGACY_MAP_MESSAGE_FORMAT = "use_legacy_map_msg_format"; public static final String OPTIONS_BROKERLIST = "brokerlist"; public static final String OPTIONS_FAILOVER = "failover"; public static final String OPTIONS_FAILOVER_CYCLE = "cyclecount"; diff --git a/java/common/src/main/java/org/apache/configuration/ClientProperties.java b/java/common/src/main/java/org/apache/configuration/ClientProperties.java index 29d07eade7..90eec34713 100644 --- a/java/common/src/main/java/org/apache/configuration/ClientProperties.java +++ b/java/common/src/main/java/org/apache/configuration/ClientProperties.java @@ -82,7 +82,9 @@ public class ClientProperties extends PropertyNameResolver * Currently the two types are Binding URL (java only) and the Addressing format (used by * all clients). */ - public static final String DEST_SYNTAX = "dest_syntax"; + public static final String DEST_SYNTAX = "qpid.dest_syntax"; + + public static final String USE_LEGACY_MAP_MESSAGE_FORMAT = "qpid.use_legacy_map_message"; /** * ========================================================== |