diff options
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java | 9 | ||||
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java | 8 |
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 |
