A Connection object represents an application's active connection to a broker.
IBM.XMS.IPropertyContext | +----IBM.XMS.IConnection
For a list of the XMS defined properties of a Connection object, see Properties of Connection.
.NET property | Description |
---|---|
ClientID | Get and set the client identifier for the connection. |
ExceptionListener | Get the exception listener that is registered with the connection, and register an exception listener with the connection. |
MetaData | Get the metadata for the connection. |
String ClientID { get; set; }
Get and set the client identifier for the connection.
The client identifier can either be preconfigured by the administrator in a ConnectionFactory, or assigned by setting ClientID.
A client identifier is used only to support durable subscriptions in the publish/subscribe domain, and is ignored in the point-to-point domain.
If an application sets a client identifier for a connection, the application must do so immediately after creating the connection, and before performing any other operation on the connection. If the application tries to set a client identifier after this point, the call throws exception IllegalStateException.
This property is not valid for a real-time connection to a broker.
ExceptionListener ExceptionListener { get; set; }
Get the exception listener that is registered with the connection, and register an exception listener with the connection.
If no exception listener is registered with the connection, the method returns null. If an exception listener is already registered with the connection, you can cancel the registration by specifying a null instead of the exception listener.
For more information about using exception listeners, see Message and exception listeners in .NET.
Method | Description |
---|---|
Close | Close the connection. |
CreateSession | Create a session. |
Start | Start, or restart, the delivery of incoming messages for the connection. |
Stop | Stop the delivery of incoming messages for the connection. |
ISession CreateSession(Boolean transacted, AcknowledgeMode acknowledgeMode);
For a real-time connection to a broker, the value must be False.
This parameter is ignored if the session is transacted. For more information about acknowledgement modes, see Message acknowledgement.