| Previous | Next |
| MQ_ERROR_TRANSACTION_ENLIST | MQ_ERROR_ILLEGAL_CONTEXT |
MQ_ERROR_QUEUE_DELETED
Operational meaning
MQ_ERROR_QUEUE_DELETED means that an open handle refers to a queue that has been deleted, not merely that the transport is unavailable. Recreating a queue with the same path does not make the old handle valid.
Reopening by the same path after deletion can identify a new queue object. When diagnosing this result, the application must decide whether resuming against that new object is safe or whether the work item belongs to the old generation.
For asynchronous or transactional reads, cleanup must be coordinated with callback and transaction owners. Closing a handle from another thread can be the cause rather than the cure.
Where the condition occurs
| Subsystem | queue and handle lifetime across deletion, service restart, asynchronous reads, and competing consumers |
|---|---|
| Relevant condition | an object that was valid when opened may no longer identify the same queue-manager generation or message |
| Code-specific focus | open handle refers to a queue that has been deleted |
The same pathname does not prove object identity across restart or recreation. Handles and message lookup IDs belong to a particular lifetime. The code-specific boundary is open handle refers to a queue that has been deleted.
Evidence to preserve
- Queue deletion/recreation events and current format name.
- Lookup id, cursor action, transaction, and competing consumer activity.
- Handle creation time and msmq service restart time.
Handling and recovery
Close it, resolve the intended new queue, and reopen explicitly.
Nearby failures
Reusing the same pathname after restart or recreation does not revive the old handle, lookup identifier, message lock, or transaction context. Code-specific condition: open handle refers to a queue that has been deleted.
Worked example
A long-running consumer encounters it. It closes invalid objects, resolves the current queue generation, and reconciles whether another consumer completed the work.
References
Looking for a different code? Search another status or error code.