Integration of MQ Telemetry with queue managers
The MQTT client is integrated with IBM® MQ as a publish/subscribe application. It can either publish or subscribe to topics in IBM MQ, creating new topics, or using existing topics. It receives publications from IBM MQ as a result of MQTT clients, including itself, or other IBM MQ applications publishing to the topics of its subscriptions. Rules are applied to decide the attributes of a publication.
Many of the attributes associated with topics, publications, subscriptions, and messages that are provided by IBM MQ, are not supported. MQTT client to IBM MQ publish/subscribe broker and IBM MQ to an MQTT client describe how attributes of publications are set. The settings depend on whether the publication is going to or from the IBM MQ publish/subscribe broker.
In IBM MQ publish/subscribe topics are associated
with administrative topic objects. The topics created by MQTT clients are no different. When an MQTT client creates a topic string for a publication the
IBM MQ publish/subscribe broker associates it with an
administrative topic object. The broker maps the topic string in the publication to the nearest
administrative topic object parent. The mapping is the same as for IBM MQ applications. If there is no user created topic, the
publication topic is mapped to SYSTEM.BASE.TOPIC
. The attributes that are applied
to the publication are derived from the topic object.
When an IBM MQ application, or an administrator
creates a subscription, the subscription is named. List subscriptions using IBM MQ Explorer, or by using runmqsc or PCF commands. All MQTT client subscriptions are named. They are given a name of the form: ClientIdentifier:Topic name
MQTT client to IBM MQ publish/subscribe broker
MQMD field | Type | Value |
---|---|---|
Format | MQCHAR8 |
|
UserIdentifier | MQCHAR12 |
Set to one of:
|
Priority | MQLONG |
|
Persistence | MQLONG |
|
The RFH2 header does not contain an <msd>
folder to define
the type of the JMS message. The telemetry (MQXR)
service creates the IBM MQ message as a default JMS message. The default JMS message-type is a jms-bytes
message. An
application can access additional header information as message properties; see Message properties.
RFH2 property | Type/Folder | Header |
---|---|---|
Format | MQCHAR8 |
|
ClientIdentifier | mqtt/clientId |
Copy MqttClient.ClientIdentifier with a length of 1...23 bytes. |
QoS | mqtt/qos |
Copy QoS from incoming MQTT message. |
Message ID | mqtt/msgid |
Copy Message ID from incoming MQTT message, if QoS is |
MQIsRetained |
mqps/Ret |
Set if the original MQTT publication was sent
with the |
MQTopicString |
mqps/Top |
The topic to which the MQTT message was published. |
The payload in an MQTT publication is mapped to the contents of an IBM MQ message:
Message contents | Type | Contents of IBM MQ message |
---|---|---|
Buffer | MQBYTE n |
Copy of bytes from incoming MQTT message. The length can be zero. |
IBM MQ to an MQTT client
MQTT field | Type | Value |
---|---|---|
DUP | boolean |
Set if |
QoS | int |
The way the value of QoS in an outgoing publication from the publish/subscribe
broker in IBM MQ is set depends on the incoming
publication. It depends on whether the incoming publication was sent from an MQTT client, or from an IBM MQ application.
|
RETAIN | boolean |
Set if the incoming publication has the retained property set. |
MQTT field | Type | Value |
---|---|---|
Topic name | String |
The topic string the message was published with. |
Message ID | String |
The last 2 bytes of the MQMD.MsgId property of the publication when it is placed
in |
Payload | byte[] |
Direct copy of bytes from incoming publication to the publish/subscribe broker. The length can be zero. |