What it means
2033 is often normal: the queue is empty, or the wait interval ran out. It becomes a problem when a message you expected is not found. MQGET only returns messages that match its selection, such as the message ID and correlation ID, and it cannot see messages that were put but not yet committed. A browse also returns 2033 at the end of the queue.
Typical causes
- The queue really is empty, or the sender has not sent yet.
- The sender put the message under syncpoint and has not committed it.
- The program did not reset MsgId and CorrelId between gets, so it only matches one old message.
- The wait interval is too short for the time the reply takes.
- The program is reading a different queue or queue manager from the one the sender uses.
How to fix it
- Decide if 2033 is expected; for polling loops it is not an error.
- Check queue depth with DISPLAY QLOCAL(name) CURDEPTH, and uncommitted messages with DISPLAY QSTATUS(name) UNCOM.
- Before each get, set MsgId to MQMI_NONE and CorrelId to MQCI_NONE unless you mean to match them.
- Check that the sender committed its unit of work, and increase the wait interval if replies are slow.
Example
Illustrative only; names and values are invented.
MQGET returned CompCode=2 Reason=2033 Queue=APP.REPLY.QUEUE Wait=5000ms
DISPLAY QSTATUS(APP.REPLY.QUEUE) CURDEPTH UNCOM