IBM MQ Request Reply protocol

There are two scenarios where the request reply protocol can be used:
  • Hosted service - this is where FTM is the requested service
  • Invoked service - this is where FTM calls an external service.

Hosted Service

The requesting client provides the following information in the IBM® MQ Message Descriptor (MQMD)
  • ReplyToQ
  • ReplyToQMgr (Optional)
  • MsgId
  • CorrelId
  • MsgType = MQMT_REQUEST

With the MsgType field set to MQMT_REQUEST by the calling client, the hosted service generates and sends a reply message to the queue specified in the ReplyToQ field.

If the ReplyToQMgr field is not set, IBM MQ will use the local queue manager.

When the hosted service replies, it must also pass a correlation identifier. This value may be the original MsgId or the original CorrelId. In FTM, this is determined by the correlation scheme of the service participant.

The following figure shows the configuration changes required to implement the FTM Sample App as a hosted service.

Figure 1. Hosted service example
MQReqRep_Hosted.jpg

Invoked Service

An invoked service is where FTM calls an external IBM MQ service that expects to use the request/reply protocol.

FTM sets the required MQMD fields as follows:
  • The ReplyToQ and ReplyToQMgr fields are set based on the outbound Channel properties (QMgr / Queue).
  • The MsgId and CorrelId fields are set based on the current IBM MQ support.
  • The MsgType is set to MQMT_REQUEST.

The following figure shows the configuration changes required in the FTM Sample App to call the liquidity service as an invoked service.

Figure 2. Invoked service example
MQReqRep_Invoked.jpg