Using report messages for problem determination

The remote queue manager cannot report errors such as failing to put a message on a queue when you make your MQI call, but it can send you a report message to say how it has processed your message.

Within your application you can create (MQPUT) report messages as well as select the option to receive them (in which case they are sent by either another application or by a queue manager).

Creating report messages

Report messages enable an application to tell another application that it cannot deal with the message that was sent.

However, the Report field must initially be analyzed to determine whether the application that sent the message is interested in being informed of any problems. Having determined that a report message is required, you have to decide:
  • Whether you want to include the entire original message, just the first 100 bytes of data, or none of the original message.
  • What to do with the original message. You can discard it or let it go to the dead-letter queue.
  • Whether the contents of the MsgId and CorrelId fields are needed as well.

Use the Feedback field to indicate the reason for the report message being generated. Put your report messages on an application's reply-to queue. See Feedback for further information.

Requesting and receiving (MQGET) report messages

When you send a message to another application, you are not informed of any problems unless you complete the Report field to indicate the feedback that you require. See Structure of the report field for the options available.

Queue managers always put report messages on an application's reply-to queue and it is recommended that your own applications do the same. When you use the report message facility, specify the name of your reply-to queue in the message descriptor of your message; otherwise, the MQPUT call fails.

Your application must contain procedures that monitor your reply-to queue and process any messages that arrive on it. Remember that a report message can contain all the original message, the first 100 bytes of the original message, or none of the original message.

The queue manager sets the Feedback field of the report message to indicate the reason for the error; for example, the target queue does not exist. Your programs should do the same.

For more information about report messages, see Report messages.