Gets the client identifier for this connection.

Sets the client identifier for this connection.

The preferred way to assign a JMS client's client identifier is for it to be configured in a client-specific ConnectionFactory object and transparently assigned to the Connection object it creates.

Alternatively, a client can set a connection's client identifier using a provider-specific value. The facility to set a connection's client identifier explicitly is not a mechanism for overriding the identifier that has been administratively configured. It is provided for the case where no administratively specified identifier exists. If one does exist, an attempt to change it by setting it must throw an IllegalStateException. If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw an IllegalStateException.

The purpose of the client identifier is to associate a connection and its objects with a state maintained on behalf of the client by a provider. The only such state identified by the JMS API is that required to support durable subscriptions.

If another connection with the same clientID is already running when this method is called, the JMS provider should detect the duplicate ID and throw an InvalidClientIDException.

Namespace:  Kaazing.JMS
Assembly:  Kaazing.JMS (in Kaazing.JMS.dll)

Syntax

Visual Basic
Property ClientID As String
	Get
	Set
C#
string ClientID { get; set; }
Visual C++
property String^ ClientID {
	String^ get ();
	void set (String^ value);
}

Return Value

the unique client identifier

Exceptions

ExceptionCondition
Kaazing.JMS..::..JMSExceptionif the JMS provider fails to return the client ID for this connection due to some internal error.
Kaazing.JMS..::..JMSExceptionif the JMS provider fails to set the client ID for this connection due to some internal error.
Kaazing.JMS..::..InvalidClientIDExceptionif the JMS client specifies an invalid or duplicate client ID.
Kaazing.JMS..::..IllegalStateExceptionif the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.

See Also