Distribution program (CSQ4CVB4)

 

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.Bn.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. If you want to modify the sample application to show this, see The Credit Check sample with multiple queue managers.

The distribution program performs the following steps:

  1. 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.

  2. Opens these queues and also CSQ4SAMP.B4.MESSAGES.

  3. Performs the following loop until there are no more messages on queue CSQ4SAMP.B4.MESSAGES:

    1. Get a message using the MQGET call with the wait option, and with the wait interval set to 30 seconds.

    2. 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.

    3. Send a datagram message to queue CSQ4SAMP.B2.REPLY.n to show how many messages it has successfully put.

    4. Declare a syncpoint.

 

Parent topic:

Design of the sample


fg18610_