This section describes the components of distributed queuing. These are:
Message channels are the channels that carry messages from one queue manager to another.
Do not confuse message channels with MQI channels. There are two types of MQI channel, server-connection and client-connection. These are discussed in the WebSphere MQ Clients book.
The definition of each end of a message channel can be one of the following types:
A message channel is defined using one of these types defined at one end, and a compatible type at the other end. Possible combinations are:
A sender in one system starts the channel so that it can send messages to the other system. The sender requests the receiver at the other end of the channel to start. The sender sends messages from its transmission queue to the receiver. The receiver puts the messages on the destination queue. Figure 5 illustrates this.
Figure 5. A sender-receiver channel
A requester in one system starts the channel so that it can receive messages from the other system. The requester requests the server at the other end of the channel to start. The server sends messages to the requester from the transmission queue defined in its channel definition.
A server channel can also initiate the communication and send messages to a requester, but this applies only to fully qualified servers, that is server channels that have the connection name of the partner specified in the channel definition. A fully qualified server can either be started by a requester, or can initiate a communication with a requester.
Figure 6. A requester-server channel
The requester starts the channel and the sender terminates the call. The sender then restarts the communication according to information in its channel definition (this is known as callback). It sends messages from the transmission queue to the requester.
Figure 7. A requester-sender channel
This is similar to sender-receiver but applies only to fully qualified servers, that is server channels that have the connection name of the partner specified in the channel definition. Channel startup must be initiated at the server end of the link. The illustration of this is similar to the illustration in Figure 5.
In a cluster, each queue manager has a cluster-sender channel on which it can send cluster information to one of the full repository queue managers. Queue managers can also send messages to other queue managers on cluster-sender channels.
Figure 8. A cluster-sender channel
In a cluster, each queue manager has a cluster-receiver channel on which it can receive messages and information about the cluster. The illustration of this is similar to the illustration in Figure 8.
A message channel agent (MCA) is a program that controls the sending and receiving of messages. There is one message channel agent at each end of a channel. One MCA takes messages from the transmission queue and puts them on the communication link. The other MCA receives messages and delivers them onto a queue on the remote queue manager.
A message channel agent is called a caller MCA if it initiated the communication, otherwise it is called a responder MCA. A caller MCA may be associated with a sender, cluster-sender, server (fully qualified), or requester channel. A responder MCA may be associated with any type of message channel, except a cluster sender.
A transmission queue is a special type of local queue used to store messages before they are transmitted by the MCA to the remote queue manager. In a distributed-queuing environment, you need to define one transmission queue for each sending MCA, unless you are using WebSphere MQ Queue Manager clusters.
You specify the name of the transmission queue in a remote queue definition, (see Remote queue definitions). If you do not specify the name, the queue manager looks for a transmission queue with the same name as the remote queue manager.
You can specify the name of a default transmission queue for the queue manager. This is used if you do not specify the name of the transmission queue, and a transmission queue with the same name as the remote queue manager does not exist.
A channel initiator acts as a trigger monitor for sender channels, because a transmission queue may be defined as a triggered queue. When a message arrives on a transmission queue that satisfies the triggering criteria for that queue, a message is sent to the initiation queue, triggering the channel initiator to start the appropriate sender channel. You can also start server channels in this way if you specified the connection name of the partner in the channel definition. This means that channels can be started automatically, based upon messages arriving on the appropriate transmission queue.
You need a channel listener program to start receiving (responder) MCAs. Responder MCAs are started in response to a startup request from the caller MCA; the channel listener detects incoming network requests and starts the associated channel.
Figure 9 shows how channel initiators and channel listeners are used.
Figure 9. Channel initiators and listeners
The implementation of channel initiators is platform specific.
The channel initiator is also required for other functions. These are discussed later in this book.
The implementation of channel listeners is platform specific.
If you want to do some additional processing (for example, encryption or data compression) you can write your own channel-exit programs, or sometimes use SupportPacs. The Transaction Processing SupportPacs library for WebSphere MQ is available on the Internet at URL:
WebSphere MQ calls channel-exit programs at defined places in the processing carried out by the MCA. There are six types of channel exit:
The sequence of processing is as follows:
This is illustrated in Figure 10.
Figure 10. Sequence in which channel exit programs are called
The message-retry exit is used to determine how many times the receiving MCA will attempt to put a message to the destination queue before taking alternative action. It is not supported on WebSphere MQ for z/OS.
For more information about channel exits, see Chapter 45, Channel-exit programs.