The Object Descriptor (MQOD) answers one question for MQOPEN: which IBM MQ object do you want to use? While MQCONN attaches you to a queue manager, MQOD names the queue, topic, or model that becomes an Hobj handle. Mistyped ObjectName values produce reason 2085 unknown object; wrong ObjectType produces 2042 object type error. Dynamic reply queues depend on MQOD fields the queue manager fills in after open—beginners lose replies because they never read DynamicQName back from the descriptor. Alternate user and object queue manager fields support gateway and cross-queue-manager patterns under strict authority. This tutorial explains each major MQOD field, initialization with MQOD_DEFAULT, opening aliases versus locals, model and dynamic queue flows, topic opens, and how MQOD output differs from input after a successful open.
Always start from MQOD_DEFAULT so reserved fields are zero. Set ObjectType before ObjectName when learning—some samples set both explicitly. Reusing MQOD from a previous open without re-init leaves stale DynamicQName or alternate user fields that cause surprising 2035 authority results.
123456MQOD od = {MQOD_DEFAULT}; od.ObjectType = MQOT_Q; strncpy(od.ObjectName, "ORDERS.IN", MQ_Q_NAME_LENGTH); MQOPEN(Hconn, &od, MQOO_OUTPUT, &Hobj, &compCode, &reason);
| Field | In / Out | Meaning |
|---|---|---|
| ObjectName | In | Queue or topic name to open |
| ObjectType | In | MQOT_Q, MQOT_TOPIC, etc. |
| ObjectQMgrName | In | Target QM if not connected QM |
| DynamicQName | Out | Name created for dynamic queue |
| AlternateUserId | In | Open as another user if permitted |
| AlternateSecurityId | In | Platform security id (z/OS) |
Names are case-sensitive on distributed MQ. ORDERS.IN and orders.in differ. Cluster queue names appear as the cluster object name on the connection where you open—resolution uses cluster repository. Alias queue ObjectName is the alias; the queue manager resolves to base queue on put/get. Remote queue names are rarely opened directly by applications; use alias or queue manager default transmission. Length limit 48 characters—interface specs should enforce shorter logical names for readability.
MQOD is the form you fill at the post office desk saying which locker number you need. ObjectType says whether it is a mailbox locker or a bulletin board (topic). DynamicQName is when they assign you a temporary locker and write the number on the form after you sign up.
Request/reply clients set ObjectName to a model queue such as SYSTEM.DEFAULT.MODEL.QUEUE or a custom QMODEL. Open options include MQOO_INPUT or output per pattern. After MQOPEN succeeds, read DynamicQName—often AMQ.xxx.GUID—and put that into MQMD ReplyToQ for the server. Server MQPUTs the reply to that name on the correct queue manager. Client MQGET on DynamicQName, then MQCLOSE. PERMDYN versus TEMPDYN behavior comes from model DEFTYPE, not from MQOD itself.
When empty, the object is assumed on the queue manager you connected to. Populating ObjectQMgrName requests open on another queue manager name—used in advanced federated scenarios and some client scenarios. Wrong name causes resolution failure. Most applications leave blank and use aliases for remote destinations instead.
AlternateUserId lets trusted servers act for many end users—payments hub opening as customer ID when AUTHREC and policies allow. Misconfiguration is a security audit finding. z/OS may use AlternateSecurityId for RACF tokens. Failed alternate open returns 2035; successful open attributes puts to the alternate identity in MQMD context fields when options request it.
ObjectType MQOT_TOPIC with topic name or string opens publication or subscription paths per API style. Pub/sub also uses MQSD for subscriptions on some calls—see MQSD tutorial. Distinct from QLOCAL depth queues but same MQOD discipline applies to naming.
MQOD selects the object once at open. MQMD describes each message on put/get. Do not put queue names in MQMD for open—that is MQOD job. ReplyToQ in MQMD is destination for message data, not open descriptor.
MQOD is the slip of paper that says which mailbox you want to open before the clerk gives you the key.
Write MQOD values to open alias PAYMENTS.ALIAS for output put.
Describe model queue open flow including which field holds the reply queue name after open.
When would ObjectQMgrName be non-empty in your architecture?
1. MQOD is passed to:
2. ObjectType MQOT_Q means:
3. DynamicQName after open contains:
4. ObjectName max length is: