Point to point transmissions with IBM MQ

asynchronous messaging

In a point-to-point paradigm data is being transferred from one application to another. The logical link is performed by the message-oriented middleware between two applications only, as presented in the image below: the sender and the receiverqueue-based transmissions

Point to point transmissions with IBM MQ imply the necessity of the following logical objects:

At source

A queue manager with the following logical objects created within:

  • a server-connection channel: a bidirectional MQI channel that is used to connect a WebSphere MQ client to a WebSphere MQ server. The server connection channel is the server end of the channel. A server-connection channel is defined with the following statements, for creation and security configuration:

DEFINE CHANNEL(QMANAGER_A.CLNT) CHLTYPE(SVRCONN) TRPTYPE(TCP) DESCR (‘Server-connection to QMANAGER_A’)

SET CHLAUTH(CHAN2) TYPE(USERMAP)  CLNTUSER(‘user_app_a’)

 

  • a sender channel: the logical link created in the source queue manager that makes possible the connection to the destination queue manager. It can be created via MQSC commands (IBM MQ commands console) with the following query:

DEFINE CHANNEL(TO.QMANAGER_B) CHLTYPE(SDR) CONNAME(‘remoteHost‘) TRPTYPE(TCP) XMITQ(QT.TO.QMANAGER_B)

A sender channel must have its corresponding receiver channel on the remote end (the destination queue manager) and both of the channels must carry the same name, as per the IBM MQ standards.

  • a remote queue: a type of queue that describes a remote queue manager, a local queue managed by that queue manager and the transmission queue that will be used in order to send the message to its destination. A remote queue can be created via MQSC commands as stated below:

DEFINE QREMOTE (QR.TO.APPLICATION_B.SCOPE) DESCR (‘Queue for transmitting message to Application B regarding SCOPE’)

 

  • a transmission queue: a local queue that is used by a queue manager that forwards messages to a remote queue manager through a sender channel.

DEFINE QLOCAL (‘QT.TO.APPLICATION_B’) DESCR (‘Default transmission queue for QMANAGER_B’) TRIGGER TRIGDATA(TO.QMANAGER_B) INITQ(SYSTEM.CHANNEL.INITQ)USAGE (XMITQ)

 

  • an alias queue: an object that can point to either a topic or another queue. They are generally used when the application requires a certain name for the queues that will be employed in the data exchange process

DEFINE QALIAS (‘SCOPE’) DESCR (‘Queue alias of QR.TO.APPLICATION_B.SCOPE’) TARGET(QR.TO.APPLICATION_B.SCOPE)  TARGTYPE(QUEUE)

 

 

At destination

A queue manager with the following logical objects created within:

  • a server-connection channel

DEFINE CHANNEL(QMANAGER_B.CLNT) CHLTYPE(SVRCONN)  TRPTYPE(TCP) DESCR (‘Server-connection to QMANAGER_B’) SET CHLAUTH(CHAN2) TYPE(USERMAP)  CLNTUSER(‘user_app_b’)

 

  • a receiver channel: a message channel that the destination queue manager employs to receive messages from other queue managers. To receive messages from another queue manager, there must be a sender channel with the same name in the source queue manager. Receiver channels can be created with the following statement.

DEFINE CHANNEL(TO.QMANAGER_B) CHLTYPE(RCVR) TRPTYPE(TCP) DESCR(‘Channel receiver from QMANAGER_A’)

 

  • a local queue: a logical object within a queue manager where the messages will be stored when arrived at destination. The name of the local queue in the destination queue manager must coincide with the value given in the attribute RNAME of the remote queue in the source queue manager. Local queues can be defined as following:

DEFINE QLOCAL(‘QL.SCOPE’) NOTRIGGER TRIGTYPE(FIRST) INITQ (‘’) DESCR (‘Queue local for SCOPE’)

 

  • an alias queue (optional)

DEFINE QALIAS(‘SCOPE’) TARGTYPE(QUEUE)  DESCR (‘Queue alias of QL.SCOPE’) TARGET(QL.SCOPE)

 

All the components can be identified in the image below. Application A connects to the queue manager QMANAGER A via a client channel and initiates the transmission with a PUT query. When the message is put onto the remote queue, it is actually placed onto the corresponding transmission queue which forwards the message to the destination queue manager via message channels (sender and receiver channels).

point to point transmissions with ibm mq

Therefore, the path of a message from source to destination in point to point transmissions with IBM MQ is the following:

  • the source application connects to the queue manager via a server-connection channel
  • it places the message onto an alias or directly onto a remote queue via a MQPUT statement
  • the message is actually placed onto the transmission queue defined for the remote queue and then triggers the sender channel associated to the transmission queue
  • the message is received by the destination queue manager through the channel receiver and placed onto the local queue defined at source in the remote queue
  • the application at destination connect to the queue manager via a server-connection channel and invokes a queue alias pointing to the local queue or the local queue directly and gets the message via an MQGET statement.

asynchronous messaging

Leave a Reply

Your email address will not be published. Required fields are marked *