Distribution program (CSQ4CVB4) on z/OS
The distribution program is started by a trigger event on queue CSQ4SAMP.B4.MESSAGES.
To simulate the distribution of the loan request to other agencies that have access to records such as credit card history, savings accounts, and mortgage payments, the program puts a copy of the same message on all the queues in the namelist CSQ4SAMP.B4.NAMELIST. There are three of these queues, with names of the form CSQ4SAMP.B n.MESSAGES, where n is 5, 6, or 7. In a business application, the agencies could be at separate locations, so these queues could be remote queues. To modify the sample application to show this, see The Credit Check sample with multiple queue managers on z/OS.
The distribution program performs the following steps:- From the namelist, gets the names of the queues that the program is to use. The program does this by using the MQINQ call to inquire about the attributes of the namelist object.
- Opens these queues and also CSQ4SAMP.B4.MESSAGES.
- Performs the following loop until there are no more messages on queue CSQ4SAMP.B4.MESSAGES:
- Get a message using the MQGET call with the wait option, and with the wait interval set to 30 seconds.
- Put a message on each queue listed in the namelist, specifying the name of the appropriate CSQ4SAMP.B2.REPLY.n queue for the reply-to queue. The program copies the CorrelId of the loan request message to these copy messages, and it uses the MQPMO_PASS_IDENTITY_CONTEXT option on the MQPUT call.
- Send a datagram message to queue CSQ4SAMP.B2.REPLY.n to show how many messages it has successfully put.
- Declare a syncpoint.
Parent topic: Design of the Credit Check sample on z/OS