IBM Support

Creating MQ PUB/SUB in Business Developer

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.

image 12681


Prerequisites 
  • IBM Rational Business Developer (RBD). 
  • Knowledge of developing code using EGL.  
  • Knowledge of generating the COBOL programs from EGL.
Topic Record properties

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.

Message Structures

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.

MQRecord property

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

Topic Record Code:

isTopicRecord property to decide whether MQ Record is used for Topic or Queue. Default is No.
 
image 12683

After it recognizes it’s topic record, the topicname property value matches with the resource association filename.
image 12684
If we need a durable subscription, then we should provide the subscriptionName too. This name should be unique for a particular queue manager. SubscriptionName can be provided in the resource association too.
 
image 12685

We use the existing MQ record filename (System & Filetype) for Topic resource association. Below is the format in which we can provide the same.
 
image 12691

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. 
 
image 12692

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.
image 12693
 
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.

[{"Type":"MASTER","Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMQ79","label":"Rational Business Developer"},"ARM Category":[{"code":"a8m0z0000000BB1AAM","label":"Rational Business Developer"}],"ARM Case Number":"","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"9.7.0"}]

Document Information

Modified date:
20 June 2022

UID

ibm16595991