diff options
| author | Arnaud Simon <arnaudsimon@apache.org> | 2008-05-05 11:14:55 +0000 |
|---|---|---|
| committer | Arnaud Simon <arnaudsimon@apache.org> | 2008-05-05 11:14:55 +0000 |
| commit | caf22ff7b52b845b5313033de91dfd312b14a396 (patch) | |
| tree | 63e3a30cdaae5badb15d92b29c03f6fd33f29166 /java | |
| parent | 5960588d5e0694056723e46c0fd084405c68dbc1 (diff) | |
| download | qpid-python-caf22ff7b52b845b5313033de91dfd312b14a396.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/qpid@653426 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQConnection.java | 9 | ||||
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java | 8 |
2 files changed, 16 insertions, 1 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 aa402a436e..319c6c2b1a 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 @@ -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/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java b/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java index c7fc21a121..edda18c715 100644 --- a/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java +++ b/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 |
