Reply-to queues are how IBM MQ answers the question where should the response go without coupling server code to every client installation. The requester encodes return routing in ReplyToQ and optionally ReplyToQMgr on the message descriptor; the service reads those fields and puts the reply there. Enterprise request/reply, CICS clients talking to Linux services, and Java microservices on the mainframe all use the same mechanism. This page explains static versus dynamic reply queues, model queue definitions, remote reply across queue managers, security and authorization on reply puts, common misconfigurations, timeouts, and how ReplyToQ works with CorrelId and MsgId from the correlation and message ID tutorials.
ReplyToQ is a 48-character queue name (platform rules apply for name length and characters). ReplyToQMgr is a 48-character queue manager name. When the server processes a request on QM_SERVER and ReplyToQ is APP01.REPLY on QM_APP01, the server put must reach QM_APP01—often via a remote queue definition or default reply queue manager handling depending on API and channel setup. When both client and server share one queue manager, ReplyToQMgr is often blank and the reply is local. Always verify PUT authority on the reply queue for the server connection id.
| Pattern | ReplyToQ | ReplyToQMgr |
|---|---|---|
| Local dynamic | SYSTEM.MQ*.generated name | Blank (same QM) |
| Local static | CLIENT.REPLIES | Blank |
| Remote reply | CLIENT.REPLIES | QM_CLIENT |
| Invalid | Blank or deleted queue | Wrong name |
The requester opens a model queue such as REPLY.MODEL with MQOPEN options that create a dynamic queue. MQ returns a name like AMQ85942.REPLY.MODEL. That name becomes ReplyToQ on the request put. Only the creating connection typically reads it until shared—by design private. When the connection closes, the dynamic queue disappears unless retained by options—check your client. Model queues set DEFTYPE(TEMPDYN) or similar and attributes like MAXDEPTH, SHARE, and DEFPSIST that dynamic queues inherit.
Older designs use one queue REPLIES.ALL for many clients. Each request must set CorrelId/MQGET match so clients do not steal each other replies. Prefer dynamic queues or per-application static queues for clarity. Shared queues still appear in legacy CICS regions—document correlation rules strictly.
Server on QM_A puts reply to QM_B requires either ReplyToQMgr open on QM_A with channels to QM_B, or putting to a QREMOTE that resolves to the client reply queue. Asymmetric firewalls often block reply path even when requests flow in. Network diagrams must show bidirectional channel or independent reply channels. Test reply puts in lower environments with the same CONNAME and TLS as production.
JMSQueueSession.createTemporaryQueue() maps to MQ dynamic reply infrastructure. ReplyToQ in underlying MQMD is set when using JMSReplyTo. Ensure requestor consumes with the same session or saves destination. MQI and JMS mixed flows need a mapping document for operations.
1234567DEFINE QMODEL('REPLY.MODEL') REPLACE + DEFTYPE(TEMPDYN) MAXDEPTH(1000) SHARE + DEFPSIST(NO) * Application: MQOPEN model with options to create dynamic queue * Use returned name as ReplyToQ on request put * Server: PUT reply using ReplyToQ from request MD DISPLAY QLOCAL('REPLY.MODEL') DEFTYPE
You hand the teacher a question paper with a sticky note saying put the answer in my locker number 12. The teacher does not guess your locker—you told them where to deliver. ReplyToQ is the locker number; ReplyToQMgr is which school building if your locker is in another building.
Requests flow A→B but ReplyToQ is on A. List channel/auth checks for reply puts from B.
Compare operational cost of 500 static reply queues vs dynamic from one model.
Client times out; reply depth on ReplyToQ is 1. List five causes including CorrelId mismatch.
1. The server puts the reply to:
2. Temporary dynamic queues are created from:
3. ReplyToQMgr is needed when:
4. Shared static reply queue without CorrelId causes: