White Papers
Abstract
This document details our proposed solution for implementing support to IBM MQ pub/sub in COBOL. It covers the requirement's rationale, design approach, supports, and limitations.
Content
Introduction
Messaging is the most critical way for microservice intercommunication. To support cloud native, it must support the pub-sub messaging. EGL has a support of queues, but missing the support for pub-sub. The idea is to enable pub-sub messaging support in EGL so that
- It can be used to develop a microservice architecture program.
- It can integrate with other messages based microservice.
- This Feature is developed in Zosbatch, Zoscics & iseries.
Prerequisites
- IBM Rational Business Developer (RBD).
- Knowledge of developing code using EGL.
- Knowledge of generating the COBOL programs from EGL.
This topic record is going to support the below-listed properties in order to achieve pub/sub in COBOL:
Property name |
Old/New |
Mandatory |
Description |
Filename |
Existing |
Yes |
This matches with MQRecord Resource Association. Can be used for the Topic record as well. |
queueName |
Existing |
Optional |
The queue to read and write from (not needed for managed subscriptions). It is mandatory in case of record is used for Queue. |
topicName |
New |
Yes |
The topicName is the only property going to match with the resource association filename. It is mandatory in case of record used for Topic. |
isTopicrecord |
New |
Yes |
This property is used to confirm Topicrecord. The default value is “NO”. |
topicString |
New |
Optional |
This property is used to hold the tree structure of topic nodes to be subscribed. |
subscriptionName |
New |
Optional |
The durable subscription to read from. If not specified, then we use a non-durable. |
MessageFormat |
New |
Optional |
The type of message format we are supporting for the topic. i.e., TEXT, BINARY. Note: This property is not yet decided for COBOL generation. |
Below are message structures that will be used in pub/sub. In the current system, the message structure is not supporting pub/sub. To support, we are updating the header files version to 4.
Usage |
Impacted MQ Functions |
Structure passed in MQ Functions |
|
queueDescriptorRecord |
Optional |
MQOPEN, MQCLOSE |
MQOD |
OpenOptionsRecord |
Optional |
MQOPEN, MQCLOSE |
MQOO |
getOptionsRecord |
Optional |
MQGET |
MQGMO |
putOptionsRecord |
Optional |
MQPUT |
MQPMO |
msgDescriptorRecord |
Optional |
MQGET, MQPUT |
MQMD |
subDescriptorRecord |
Optional |
MQSUB |
MQSD |
isTopicRecord property to decide whether MQ Record is used for Topic or Queue. Default is No.
After it recognizes it’s topic record, the topicname property value matches with the resource association filename.
We use the existing MQ record filename (System & Filetype) for Topic resource association. Below is the format in which we can provide the same.
Below is the format of values accepted for systemName while processing for Topic,
QueueManagerName:Quename:TopicString:
QueueManagerName::TopicString:
QueueManagerName:Quename::Topic name
QueueManagerName:::Topic name
QueueManagerName
Default values are used as defined in the record property. If Resource Association systemName is provided, then take high precedence unless overwriting systemName inside the EGL program. If so, then overwritten values are taking high precedence.
An Example showing the Pub-Sub
We need to use the add command to publish the message in the specified queue.
add will publish the message in the designated queue. To read the message, we can use the command mqgmo, which is the get message option.
Restrictions
We have some restrictions on this design as below:
• Topic PUB-SUB features can be used only by Existing MQ Record.
• At a time, either topicName or topicString should be used for PUB-SUB.
• To implement PUB-SUB, we are using message structure level up to 4.
• Maximum characters allowed in the resource association systemName is 97. (Including queue Manager, QueueName, topicString, topicName)
• The special characters allowed in the Topic string are “/”, ” +”, “*”, and “#” .
• Maximum length of Topic name is 48.
• Maximum length of the Topic string is 97 when provided in a property value.
Was this topic helpful?
Document Information
Modified date:
20 June 2022
UID
ibm16595991