Sample programs for asynchronous message consumption

This set of sample programs in COBOL shows you how IBM® MQ asynchronous message consumption and callback routines work in the CICS® environment. To use IBM MQ asynchronous message consumption, you must have Version 7 or later of IBM MQ. The sample programs are supplied with IBM MQ.

Run the sample registration client program to register three callback routines, which are an event handler and two message consumers, and start asynchronous message consumption. You can then use the sample messaging client program to send messages from a CICS terminal to a queue and a topic in IBM MQ, for asynchronous consumption by the two message consumers. You can use these messages to instruct one of the message consumers to deregister, resume, or suspend the callback routines, or to stop asynchronous message consumption.

Table 1. Sample COBOL programs for asynchronous message consumption
Sample program Function Actions
CSQ4CVRG Registration client Registers event handler and message consumers. Runs under CICS transaction MVRG.
CSQ4CVPT Messaging client Publishes your messages to a topic or sends your control messages to a queue. Runs under CICS transaction MVMP.
CSQ4CVCN Message consumer for basic messages Consumes your IBM MQ messages that are published under the topic News/Media/Movies.
CSQ4CVCT Message consumer for control messages Consumes your control messages from the SAMPLE.CONTROL.QUEUE queue and issues appropriate MQCB or MQCTL commands to stop asynchronous message consumption or deregister, resume, or suspend a callback routine.
CSQ4CVEV Event handler Receives notifications from IBM MQ when a condition occurs that affects the whole callback environment, such as a queue manager stopping or quiescing.