Design of the Distribution List sample

 

Put Message Records (MQPMRs) specify message attributes for each destination. The sample provides values for MsgId and CorrelId, and these override the values specified in the MQMD structure.

The PutMsgRecFields field in the MQPMO structure indicates which fields are present in the MQPMRs:

  MQLONG PutMsgRecFields=MQPMRF_MSG_ID + MQPMRF_CORREL_ID;

Next, the sample allocates the response records and object records. The object records (MQORs) require at least one pair of names and an even number of names, that is, ObjectName and ObjectQMgrName.

The next stage involves connecting to the queue managers using MQCONN. The sample attempts to connect to the queue manager associated with the first queue in the MQOR; if this fails, it goes through the object records in turn. You are informed if it is not possible to connect to any queue manager and the program exits.

The target queues are opened using MQOPEN and the message is put to these queues using MQPUT. Any problems and failures are reported in the response records (MQRRs).

Finally, the target queues are closed using MQCLOSE and the program disconnects from the queue manager using MQDISC. The same response records are used for each call stating the CompCode and Reason.

 

Parent topic:

The Distribution List sample program


fg17220_