Author: arnaudsimon
Date: Mon May 5 04:14:55 2008
New Revision: 653426
URL: http://svn.apache.org/viewvc?rev=653426&view=rev
Log:
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.
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java?rev=653426&r1=653425&r2=653426&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
Mon May 5 04:14:55 2008
@@ -822,7 +822,14 @@
// 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
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java?rev=653426&r1=653425&r2=653426&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
Mon May 5 04:14:55 2008
@@ -25,6 +25,14 @@
{
/**
+ * 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