summaryrefslogtreecommitdiff
path: root/qpid/java/client/src
diff options
context:
space:
mode:
authorArnaud Simon <arnaudsimon@apache.org>2008-05-05 11:14:55 +0000
committerArnaud Simon <arnaudsimon@apache.org>2008-05-05 11:14:55 +0000
commit5aca75e52792ee56ca01623c6bb38760c5362c28 (patch)
tree600e60226d0b78edeecbe67b846d0f40b51f99f4 /qpid/java/client/src
parent7434496d1a833f5a00f7c7edbe4bcd77b00902e0 (diff)
downloadqpid-python-5aca75e52792ee56ca01623c6bb38760c5362c28.tar.gz
QPID-1005: Added a property for ignoring setClientID so we are compatible with legacy applications that don't rely on the ID being set on the connection URL.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@653426 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java9
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java8
2 files changed, 16 insertions, 1 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
index aa402a436e..319c6c2b1a 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
@@ -822,7 +822,14 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
// in AMQP it is not possible to change the client ID. If one is not specified
// upon connection construction, an id is generated automatically. Therefore
// we can always throw an exception.
- throw new IllegalStateException("Client name cannot be changed after being set");
+ if (!Boolean.getBoolean(ClientProperties.IGNORE_SET_CLIENTID_PROP_NAME))
+ {
+ throw new IllegalStateException("Client name cannot be changed after being set");
+ }
+ else
+ {
+ _logger.info("Operation setClientID is ignored using ID: " + getClientID());
+ }
}
public ConnectionMetaData getMetaData() throws JMSException
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java b/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
index c7fc21a121..edda18c715 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
@@ -25,6 +25,14 @@ public class ClientProperties
{
/**
+ * Currently with Qpid it is not possible to change the client ID.
+ * If one is not specified upon connection construction, an id is generated automatically.
+ * Therefore an exception is always thrown unless this property is set to true.
+ * type: boolean
+ */
+ public static final String IGNORE_SET_CLIENTID_PROP_NAME = "ignore_setclientID";
+
+ /**
* This property is currently used within the 0.10 code path only
* The maximum number of pre-fetched messages per destination
* This property is used for all the connection unless it is overwritten by the connectionURL