Home

 

ResponseRecOffset (MQLONG)

This is the offset in bytes of the first MQRR response record from the start of the MQPMO structure. The offset can be positive or negative. ResponseRecOffset is used only when the message is being put to a distribution list. The field is ignored if RecsPresent is zero.

When putting the message to a distribution list, we can provide an array of one or more MQRR response records to identify the queues to which the message was not sent successfully (CompCode field in MQRR), and the reason for each failure (Reason field in MQRR). The message might not have been sent either because the queue failed to open, or because the put operation failed. The queue manager sets the response records only when the outcome of the call is mixed (that is, some messages were sent successfully while others failed, or all failed but for differing reasons); reason code MQRC_MULTIPLE_REASONS from the call indicates this case. If the same reason code applies to all queues, that reason is returned in the Reason parameter of the MQPUT or MQPUT1 call, and the response records are not set.

Usually, there are as many response records as there are object records specified by MQOD when the distribution list is opened; when necessary, each response record is set to the completion code and reason code for the put to the queue identified by the corresponding object record. Queues in the distribution list that fail to open must still have response records allocated for them at the appropriate positions in the array, although they are set to the completion code and reason code resulting from the open operation, rather than the put operation.

The number of response records can differ from the number of object records. If there are fewer response records than object records, the application might not be able to identify all the destinations for which the put operation failed, or the reasons for the failures. If there are more response records than object records, the excess are not used (although it must still be possible to access them). Response records are optional, but if they are supplied there must be RecsPresent of them.

Provide the response records in a similar way to the object records in MQOD, either by specifying an offset in ResponseRecOffset, or by specifying an address in ResponseRecPtr; for details of how to do this, see the ObjectRecOffset field described in MQOD - Object descriptor. However, use no more than one of ResponseRecOffset and ResponseRecPtr; the call fails with reason code MQRC_RESPONSE_RECORDS_ERROR if both are nonzero.

For the MQPUT1 call, this field must be zero. This is because the response information (if requested) is returned in the response records specified by the object descriptor MQOD.

This is an input field. The initial value of this field is 0. This field is ignored if Vis less than MQPMO_VERSION_2.



 

Home