Multiple thread support - pipelining

We can optionally allow a message channel agent (MCA) to transfer messages using multiple threads. This process, called pipelining, enables the MCA to transfer messages more efficiently, with fewer wait states, which improves channel performance. Each MCA is limited to a maximum of two threads.

You control pipelining with the PipeLineLength parameter in the qm.ini file. This parameter is added to the CHANNELS stanza:

    PipeLineLength= 1 | number
    This attribute specifies the maximum number of concurrent threads a channel uses. The default is 1. Any value greater than 1 is treated as 2.

With IBM MQ for Windows, use the IBM MQ Explorer to set the PipeLineLength parameter in the registry. See The Channels stanza for a complete description of the CHANNELS stanza.

Note:
  1. PipeLineLength applies only to V5.2 or later products.
  2. Pipelining is effective only for TCP/IP channels.

When we use pipelining, the queue managers at both ends of the channel must be configured to have a PipeLineLength greater than 1.


Channel exit considerations

Pipelining can cause some exit programs to fail, because:

  • Exits might not be called serially.
  • Exits might be called alternately from different threads.
Check the design of your exit programs before we use pipelining:

  • Exits must be reentrant at all stages of their execution.
  • When we use MQI calls, remember that we cannot use the same MQI handle when the exit is invoked from different threads.

Consider a message exit that opens a queue and uses its handle for MQPUT calls on all subsequent invocations of the exit. This fails in pipelining mode because the exit is called from different threads. To avoid this failure, keep a queue handle for each thread and check the thread identifier each time the exit is invoked.