Natively supported message types

This section outlines the messages types that are natively supported for IBM® Watson IoT Platform - Message Gateway and provides an explanation of each type.

IBM Watson IoT Platform - Message Gateway natively supports the following type of messages:

  • MQTT message
    The MQTT message is defined by the MQTT protocol specification as the PUBLISH message. (See the MQTT protocol specification document to review the specification.) It consists of a single-byte header, an optional two-byte message ID, a topic name, and the message payload. The header is a single byte containing the qualities of service (QoS) (0-2), retain flag, and dup flag. The message ID is used for QoS>0 but is only used for communications between client and server. It is not really a part of the message. The topic is a UTF-8 string, and the body is a blob of bytes. When an MQTT message is received, the MQTT protocol adds the topic name as a system property into the message. The recipient of the message is de-coupled from the originator of the message. This is useful as the consumer of the data only receives the messages when they are interested in a particular type of message and can subscribe or unsubscribe at any point from a message feed without affecting the message sender.
    Note: A server can delete a retained message if it receives a message with a zero-length payload and the Retain flag set on the same topic.
  • JMS message
    JMS message consists of a number of header fields, user properties, and a body. The body is defined by its message type which is one of the header fields. The properties are keyword, type, value tuples. A number of the header fields are arbitrary length strings. JMS supports six message types or interfaces. In addition to the base interface, Message, five subinterfaces are also supported; BytesMessage, MapMessage, ObjectMessage, StreamMessage, and TextMessage. In IBM Watson IoT Platform - Message Gateway, all JMS text messages are a UTF-8 representation of the body string. Map messages and stream messages use the concise encoding that is also used for properties. All property names and string values are also in UTF-8.
    Note: Only use JMS ObjectMessages if you are certain that the message comes from a trusted source. Using JMS ObjectMessages from other sources exposes the environment in which you run the JMS client to denial of service or authorization takeover. As it is difficult to ensure that the sender is trusted in JMS, you might choose not to use JMS ObjectMessages. If you receive a JMS ObjectMessage, do not invoke getObject() on the message.