Example 1 - Requesting activity reports

In this example the WebSphere MQ display route application connects to queue manager, QM1, and is used to generate and deliver a trace-route message to the target queue, TARGET.Q, on remote queue manager, QM2. The necessary report option is specified so that activity reports are requested as the trace-route reply message is routed. On arrival at the target queue the trace-route message is discarded. Activity information returned to the WebSphere MQ display route application using activity reports is put in order and displayed.

Figure 11. Requesting activity reports, Diagram 1

Figure 12. Requesting activity reports, Diagram 2

  • The sending message channel agent (MCA) gets the trace-route message from the transmission queue. The message is a trace-route message, therefore the MCA begins to record the activity information.

  • The ACTIVREC attribute of the queue manager (QM1) is MSG, and the MQRO_ACTIVITY option is specified in the Report field of the message descriptor, therefore the MCA will later generate an activity report. The RecordedActivities parameter value in the TraceRoute PCF group is incremented by 1.

  • The MCA checks that the MaxActivities value in the TraceRoute PCF group has not been exceeded.

  • Before the message is forwarded to QM2 the MCA follows the algorithm that is described in Forwarding (points 1, 4 and 5) and the MCA chooses to send the message.

  • The MCA then generates an activity report and puts it on the reply queue (ACTIV.REPLY.Q).

Figure 13. Requesting activity reports, Diagram 3

  • The receiving MCA receives the trace-route message from the channel. The message is a trace-route message, therefore the MCA begins to record the information about the activity.

  • If the queue manager that the trace-route message has come from is Version 5.3.1 or earlier, the MCA increments the DiscontinuityCount parameter of the TraceRoute PCF by 1. This is not the case here.

  • The ACTIVREC attribute of the queue manager (QM2) is MSG, and the MQRO_ACTIVITY option is specified, therefore the MCA will generate an activity report. The RecordedActivities parameter value is incremented by 1.

  • The target queue is a local queue, therefore the message is discarded with feedback MQFB_NOT_DELIVERED, in accordance with the Deliver parameter value in the TraceRoute PCF group.

  • The MCA then generates the final activity report and puts it on the reply queue. This resolves to the transmission queue that is associated with queue manager QM1 and the activity report is returned to queue manager QM1 (ACTIV.REPLY.Q).

Figure 14. Requesting activity reports, Diagram 4

  • Meanwhile, DSPMQRTE has been continually performing MQGETs on the reply queue (ACTIV.REPLY.Q), waiting for activity reports. It will wait for up to 120 seconds (60 seconds longer than the expiry time of the trace-route message) since -w was not specified when DSPMQRTE was started.

  • DSPMQRTE gets the 3 activity reports off the reply queue.

  • The activity reports are ordered using the RecordedActivities, UnrecordedActivities, and DiscontinuityCount parameters in the TraceRoute PCF group for each of the activities. The only value that is non-zero in this example is RecordedActivities, therefore this is the only parameter that is actually used.

  • The program ends as soon as the discard operation is displayed. Even though the final operation was a discard, it is treated as though a put took place because the feedback is MQFB_NOT_DELIVERED.

    The output that is displayed follows:

    AMQ8653: DSPMQRTE command started with options '-m QM1 -q TARG.AT.QM2 -rq ACTIV.REPLY.Q'.
    AMQ8659: DSPMQRTE command successfully put a message on queue 'QM2', queue manager 'QM1'. 
    AMQ8674: DSPMQRTE command is now waiting for information to display. 
    AMQ8666: Queue 'QM2' on queue manager 'QM1'. 
    AMQ8666: Queue 'TARGET.Q' on queue manager 'QM2'. 
    AMQ8652: DSPMQRTE command has finished.