Setting up the samples for asynchronous message consumption

Set up the sample programs to demonstrate IBM® MQ asynchronous message consumption and callback routines.

About this task

The sample programs CSQ4CVRG, CSQ4CVPT, CSQ4CVCN, CSQ4CVCT, and CSQ4CVEV are supplied with IBM MQ. For IBM MQ Version 7.01, apply the PTF for APAR PM06722 to obtain the samples. The source for the samples is in the IBM MQ library SCSQCOBS, and the load modules are in the IBM MQ library SCSQCICS.

The CICS resource definitions for the sample programs are provided in the IBM MQ group CSQ4SAMP. CSQ4SAMP also includes resource definitions for the CICS transactions MVRG and MVMP, which you use for the programs CSQ4CVRG (registration client) and CSQ4CVPT (messaging client) respectively.

Procedure

  1. Include the IBM MQ library thlqual.SCSQCICS in the DFHRPL concatenation in your CICS procedure, and ensure that the high-level qualifier thlqual is for IBM MQ Version 7.0.1 or above.
    Include the library after the CICS libraries to ensure that the correct code is used.
  2. In CICS, install the resource definitions supplied by IBM MQ for the sample programs and the transactions MVRG and MVMP, as follows:
    1. Delete any existing CSQ4SAMP group in the CICS region.
    2. If you are applying the PTF for IBM MQ Version 7.0.1, use the version of member CSQ4S100 in the library SCSQPROC that is shipped with the PTF.
      This member contains the new resource definitions.
    3. Use DFHCSDUP to update the CSD with the data set thlqual.SCSQPROC(CSQ4S100), which populates the CSQ4SAMP group.
    4. Install the CSQ4SAMP group.
    If you use the CEDA transaction to install CICS®-MQ adapter resources in an active CICS system, you must first shut down the adapter and wait until the alert monitor has finished its work.
  3. Define the queue SAMPLE.CONTROL.QUEUE, which is used by the message consumer CSQ4CVCT, to the IBM MQ queue manager or queue-sharing group that is associated with the CICS region.
    The MQCONN resource definition for the CICS region names the IBM MQ queue manager or queue-sharing group. The queue name is coded in the sample programs.
  4. Optional: Define the topic News/Media/Movies to the IBM MQ queue manager or queue-sharing group.
    If you do not define the topic, IBM MQ creates it at run time under the default Administrative Object.
    The topic, like the queue name, is coded in the sample programs.
  5. Start the sample registration client program CSQ4CVRG under the CICS transaction MVRG.
    The registration client registers the event handler CSQ4CVEV, the message consumer CSQ4CVCN, and the message consumer CSQ4CVCT with IBM MQ as callback routines.

What to do next

You can now use the sample messaging client program CSQ4CVPT to publish basic messages and create control messages and observe the effects. CSQ4CVPT, sample messaging client explains how to use CSQ4CVPT.