Part 7 — IBM MQ Support¶
7.1 MQ Overview¶
The Heirloom PL/I platform provides IBM MQ messaging support through 18 runtime classes. PL/I programs that use MQI (Message Queue Interface) calls are transpiled to Java code that invokes the Heirloom MQ emulation layer.
7.1.1 MQ Architecture¶
┌────────────────────────────────────────────┐
│ MQ Emulation Layer │
│ │
│ ┌──────────────┐ ┌───────────────────┐ │
│ │ Connection │ │ Message │ │
│ │ Management │ │ Operations │ │
│ │ │ │ │ │
│ │ MQCONN │ │ MQGET │ │
│ │ MQDISC │ │ MQPUT │ │
│ │ │ │ MQPUT1 │ │
│ └──────────────┘ └───────────────────┘ │
│ │
│ ┌──────────────┐ ┌───────────────────┐ │
│ │ Queue Mgmt │ │ Transaction │ │
│ │ │ │ Control │ │
│ │ MQOPEN │ │ │ │
│ │ MQCLOSE │ │ MQBEGIN │ │
│ │ MQINQ │ │ MQCMIT │ │
│ └──────────────┘ │ MQBACK │ │
│ └───────────────────┘ │
│ │
│ ┌────────────────────────────────────┐ │
│ │ MQ Data Structures │ │
│ │ MQMD - Message Descriptor │ │
│ │ MQOD - Object Descriptor │ │
│ │ MQGMO - Get Message Options │ │
│ │ MQPMO - Put Message Options │ │
│ └────────────────────────────────────┘ │
└────────────────────────────────────────────┘
7.1.2 MQ Support in PL/I Programs¶
PL/I programs use MQI calls through CALL statements to the MQ API functions. The compiler and runtime map these to the Heirloom MQ emulation layer.
7.2 MQ Connection Management¶
7.2.1 MQCONN / MQCONNX¶
Connect to a queue manager.
Parameters: QueueManagerName, ConnectionHandle, CompletionCode, ReasonCode
7.2.2 MQDISC¶
Disconnect from a queue manager.
Parameters: ConnectionHandle, CompletionCode, ReasonCode
7.3 MQ Queue Operations¶
7.3.1 MQOPEN¶
Open a queue or topic for access.
Parameters: ConnectionHandle, ObjectDescriptor (MQOD), OpenOptions, ObjectHandle, CompletionCode, ReasonCode
7.3.2 MQCLOSE¶
Close a queue or topic.
Parameters: ConnectionHandle, ObjectHandle, CloseOptions, CompletionCode, ReasonCode
7.3.3 MQINQ¶
Inquire about queue attributes.
Parameters: ConnectionHandle, ObjectHandle, SelectorCount, Selectors, IntAttrCount, IntAttrs, CharAttrLength, CharAttrs, CompletionCode, ReasonCode
7.4 MQ Message Operations¶
7.4.1 MQGET¶
Get a message from a queue.
Parameters: ConnectionHandle, ObjectHandle, MsgDescriptor (MQMD), GetMsgOptions (MQGMO), BufferLength, Buffer, DataLength, CompletionCode, ReasonCode
7.4.2 MQPUT¶
Put a message to an open queue.
Parameters: ConnectionHandle, ObjectHandle, MsgDescriptor (MQMD), PutMsgOptions (MQPMO), BufferLength, Buffer, CompletionCode, ReasonCode
7.4.3 MQPUT1¶
Put a single message (open, put, close in one call).
Parameters: ConnectionHandle, ObjectDescriptor (MQOD), MsgDescriptor (MQMD), PutMsgOptions (MQPMO), BufferLength, Buffer, CompletionCode, ReasonCode
7.5 MQ Transaction Control¶
7.5.1 MQBEGIN¶
Begin a unit of work.
7.5.2 MQCMIT¶
Commit the current unit of work.
7.5.3 MQBACK¶
Back out (rollback) the current unit of work.
7.6 MQ Data Structures¶
7.6.1 MQMD — Message Descriptor¶
| Field | Description |
|---|---|
| MsgId | Message identifier |
| CorrelId | Correlation identifier |
| MsgType | Message type (request, reply, datagram, report) |
| Persistence | Message persistence |
| Priority | Message priority |
| Expiry | Message expiration |
| Format | Message format name |
| Encoding | Numeric encoding |
| CodedCharSetId | Character set identifier (CCSID) |
| ReplyToQ | Reply-to queue name |
| ReplyToQMgr | Reply-to queue manager name |
| PutDate | Date message was put |
| PutTime | Time message was put |
| PutApplName | Application name |
7.6.2 MQOD — Object Descriptor¶
| Field | Description |
|---|---|
| ObjectType | Type of object (queue, topic, etc.) |
| ObjectName | Name of the object |
| ObjectQMgrName | Queue manager name |
| DynamicQName | Dynamic queue name template |
| ResolvedQName | Resolved queue name (output) |
| ResolvedQMgrName | Resolved queue manager name (output) |
7.6.3 MQGMO — Get Message Options¶
| Field | Description |
|---|---|
| Options | Get options (MQGMO_WAIT, MQGMO_SYNCPOINT, etc.) |
| WaitInterval | Wait time in milliseconds |
| MatchOptions | Matching criteria (MsgId, CorrelId) |
| Signal1 | Signal field |
7.6.4 MQPMO — Put Message Options¶
| Field | Description |
|---|---|
| Options | Put options (MQPMO_SYNCPOINT, MQPMO_NEW_MSG_ID, etc.) |
| ResolvedQName | Resolved queue name (output) |
| ResolvedQMgrName | Resolved queue manager name (output) |
7.7 MQ and PL/I Structure Mapping¶
- PL/I GROUP structures mapped to MQ data structures via
Group-to-MQ conversion - Automatic byte buffer management via
ByteBuilder - EBCDIC/ASCII encoding support
- Storage solution integration with
@get,@set,@autoannotations