mirror of https://github.com/apache/activemq.git
We should let a client change the client id on a connection even if it was set on the connection factory.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@473167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0918fba384
commit
d71bc421f8
|
@ -360,6 +360,16 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
this.userSpecifiedClientID = true;
|
||||
ensureConnectionInfoSent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default client id that the connection will use if explicitly not set with
|
||||
* the setClientId() call.
|
||||
*/
|
||||
public void setDefaultClientID(String clientID) throws JMSException {
|
||||
this.info.setClientId(clientID);
|
||||
this.userSpecifiedClientID = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the metadata for this connection.
|
||||
|
|
|
@ -260,7 +260,7 @@ public class ActiveMQConnectionFactory extends JNDIBaseStorable implements Conne
|
|||
transport.start();
|
||||
|
||||
if( clientID !=null )
|
||||
connection.setClientID(clientID);
|
||||
connection.setDefaultClientID(clientID);
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue