MQRC 2037: Handle not open for input
MQRC 2037 means an MQGET tried to consume a message through a handle not opened for input. Review the original MQOPEN and the consumer design.
Other names for this code
Also written as RC2037, reason code 2037, MQ error 2037, MQRC_NOT_OPEN_FOR_INPUT, 07F5, 0x07F5.
What it means
The application has a handle, but that handle was not opened to retrieve messages destructively. MQOO_
IBM identifies the input open options as MQOO_
A troubleshooting example
A viewer can display a message but its delete action fails with 2037. The browse handle was intentionally read-only in behavior. Decide whether deletion is an approved feature before changing the open options. If it is, obtain a separately owned input handle and test the complete consume-and-commit sequence on disposable messages. Include another consumer in the test so the chosen shared or exclusive input mode matches the real workload. Clearing the reason code without this design decision can turn a harmless viewer into a destructive tool.
Common causes
- A browse tool switches to consumption using its browse-only handle.
- A factory returns a producer handle to code that expects a consumer.
- A conditional options mask leaves out the intended input option.
How to find the problem
- Find the MQOPEN associated with the failing Hobj and capture its actual options. Include any wrapper or language framework setting.
- Check whether the operation is supposed to browse or remove the message. A mistaken destructive get may be the real application defect.
- Inspect the queue's input-sharing design before choosing an input mode. Coordinate with other consumers rather than defaulting to exclusive access.
- Exercise both the normal path and the branch that changes operation mode. Configuration-dependent bugs often disappear in a simple startup test.
How to fix it
- For a real consumer, open the queue with the appropriate input option and retain that handle for its intended lifetime.
- For a viewer, keep the browse operation instead of granting destructive input simply to clear the error.
- Add an interface boundary between viewing and consuming. Test whether a message remains on the queue after each action and after rollback where applicable.
What it looks like
Illustrative diagnostic notes; not an IBM message template. MQOPEN: MQOO_BROWSE Later MQGET requests destructive input Reason=2037 Check intended action before changing open options.
IBM documentation
IBM MQ 9.4: 2037 MQRC_NOT_OPEN_FOR_INPUT. Use the documentation for your installed release.
Related codes
Questions
Which input mode should I use?
Use shared, exclusive or queue-default input according to the queue and application concurrency design. Exclusive input is not a universal fix.
Is 2037 an authorization denial?
It identifies the handle's open mode. Authorization is a separate check; adding authority does not retrofit an existing handle.