MQeChannel

The MQeChannel class is not exposed to the API. This class is responsible for establishing a link between queue managers. As can be seen from the diagram, the object holding a reference to an open channel alters, depending on whether the channel is incoming or outgoing.

The channel timeout value is given in milliseconds. A background thread is responsible for closing the channels if they have been idle for the period of time set by the channel timeout value. It is important to make the timeout values in the client and server compatible; ideally the client should timeout before the server. This allows the client to send the server the close command when the client channel is closing, thus both ends of the channel are closed. If the server closes before the client, no such command is sent. This will result in one of the following:
  • The client socket being put into FINWAIT2 state as a result of it being closed when the partner socket is no longer able to respond with the required acknowledgement. State can be held either indefinitely or until the operating system times it out.
  • The client wishes to send another message and receives a channel-ID error from the server. The client then closes the channel and has to recreate a new channel, thus taking up time and network resources.
The channel timeout value needs to be long enough for a client and server to have finished sending/receiving messages but not so long that channels take up valuable system resources.

For outgoing channels, the channel timeout is set on the queue manager. This has to be done once the queue manager is configured. Use the MQeQueueManagerAdminMsg to set the channel timeout on the queue manager.

To set the channel timeout on incoming channels, specify the channel timeout using the administration message MQeCommunicationsListenerAdminMsg for creating or altering a listener.

When setting the channel timeout on either the listener or the queue manager, the underlying thread responsible for the channel timeout is not notified. For testing purposes, it may be worthwhile stopping then restarting the queue manager once the channel timeouts have been sent. In a production environment, once the queue manager and listener have been configured, the values are kept in the MQe registry and are therefore used when the queue manager is started.

The default value is 5 minutes.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.