IBM MQ reason code

MQRC 2052: Queue deleted

MQRC 2052 means an MQ handle refers to a dynamic queue that was deleted. Check reply-queue lifetime and cleanup before creating a replacement.

Other names for this code

Also written as RC2052, reason code 2052, MQ error 2052, MQRC_Q_DELETED, 0804, 0x0804.

What it means

The handle was associated with a dynamic queue that no longer exists for the operation. IBM also documents a z/OS case involving a dynamically created queue in a logically deleted state during MQOPEN or MQPUT1.

This differs from a newly opened unknown queue name. The useful evidence is the lifecycle: who created the dynamic queue, who held its handles and which component deleted it.

A troubleshooting example

A requester times out after five seconds and deletes its temporary reply queue. The server finishes at seven seconds and tries to reply using an earlier destination handle. Reason 2052 exposes the mismatch between processing time and queue lifetime. Test delayed responses and cancellation explicitly. The application needs a defined late-reply policy, including logging or alternative handling, rather than repeatedly reopening the same name and assuming it represents the original queue.

Common causes

  • A requester closes and deletes its reply queue before a delayed server response arrives.
  • A cleanup routine removes a dynamic queue while another component still holds a handle.
  • A cached destination handle outlives the dynamic queue it originally referenced.

How to find the problem

  1. Record the actual dynamic queue name returned at creation, not only the model queue name used to request it.
  2. Correlate creation, close, disconnect and delete activity across requester and responder logs. Include timeouts and cancellation paths.
  3. Check the model definition type and close options to establish the intended lifetime. Inspect any shared handle cache.
  4. Reproduce a delayed reply or cancelled request in a test environment. Fast happy-path responses may conceal the lifetime race.

How to fix it

  • Close the obsolete handle to release its resources; IBM documents that MQCLOSE succeeds in this situation.
  • Correct ownership and cleanup so a dynamic queue remains available for the required reply window. Invalidate cached handles when the owner ends that lifetime.
  • Choose a durable, appropriately managed reply destination when replies must survive requester absence. Recreating a queue does not automatically recover messages sent to its former incarnation.

What it looks like

Illustrative diagnostic notes; not an IBM message template.
Requester creates dynamic reply queue
Requester timeout deletes it
Delayed operation on old Hobj -> Reason=2052
Review ownership and late-reply policy.

IBM documentation

IBM MQ 9.4: 2052 MQRC_Q_DELETED. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Should I keep using the old handle?

No. Release the obsolete handle and correct the queue lifecycle. A handle for the deleted queue does not become valid when a new queue is created.

Is 2052 the same as 2085?

No. 2052 identifies a deleted dynamic queue associated with a handle. 2085 identifies an unknown object name during resolution.