Home
Error handling by the broker
Any message received by a broker that is not of Format MQFMT_RF_HEADER (or MQFMT_PCF in the case of the system management messages described in System programming) is treated as an error. It is written to the dead-letter queue (or discarded, depending on the report options), and an exception report generated, if requested. If a message is of the correct format but has some other error (for example, a syntax error), or if the broker cannot process it correctly (for example, it cannot retain a message), the following happens:
- If a response has been requested, one is generated.
- If the response cannot be enqueued at the broker, the response is put to the dead-letter queue (responses are always generated with MQRO_NONE).
- If the response cannot be put to the dead-letter queue, the response is discarded if this is allowed (this depends on the type of response message), depending on the broker configuration parameters.
- If the response could not be discarded or put to the reply-to queue or the dead-letter queue, the command is backed out, and the input message is put to the dead-letter queue with a Reason of MQRCCF_BROKER_COMMAND_FAILED, or discarded, as indicated by the report options. An exception report message is generated, if requested.
- If the input message or response cannot be put to the dead-letter queue or discarded, the command is backed out and the input message is restored to the input queue if the message is within syncpoint. The input message is retried periodically, and (less frequently) a message is written to the queue manager log to alert the administrator.
- If a response has not been requested, one is not sent, and no further action is appropriate for this message.
If an input message is put to the dead-letter queue, no response and publication messages are sent. It might be appropriate for the input message to be restored and reprocessed when the error has been resolved.
If the message is a Publish command message, and there is a problem sending an outgoing message on to a subscriber, the processing is as follows:
- The outgoing message is put to the dead-letter queue, if this is permitted by the broker and queue manager configuration. If the outgoing message cannot be put to the dead-letter queue because of a failure or because it is not permitted by the broker and queue manager configuration, it is discarded if this is permitted by the broker and queue manager configuration.
- If the outgoing message cannot be put to the dead-letter queue or discarded, the input message is restored. The input message is retried after suitable time interval, and (less frequently) a message is written to the log to alert the administrator.
Note:If the broker cannot put a publication message onto a destination queue or the dead-letter queue, and cannot discard the message, the broker continues trying to put the publication message onto the destination queue (at suitable intervals) and does not continue processing subsequent messages.The dead-letter queue and discard options for nonpersistent messages are specified in queue manager configuration file (qm.ini or equivalent). These options are described in Set up a broker.
Home