Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

MQTT Bindings

This document defines how to describe MQTT-specific information on AsyncAPI.

Version

Current version is 0.1.0.

Server Binding Object

This object contains information about the server representation in MQTT.

Fixed Fields
Field Name Type Description
clientId string The client identifier.
cleanSession boolean Whether to create a persisten connection or not. When false, the connection will be persistent.
lastWill object Last Will and Testament configuration.
lastWill.topic string The topic where the Last Will and Testament message will be sent.
lastWill.qos integer Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2.
lastWill.message string Last Will message.
lastWill.retain boolean Whether the broker should retain the Last Will and Testament message or not.
keepAlive integer Interval in seconds of the longest period of time the broker and the client can endure without sending a message.
bindingVersion string The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.

Example
servers:
  production:
    bindings:
      mqtt:
        clientId: guest
        cleanSession: true
        lastWill:
          topic: /last-wills
          qos: 2
          message: Guest gone offline.
          retain: false
        keepAlive: 60
        bindingVersion: 0.1.0

Channel Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.

Operation Binding Object

This object contains information about the operation representation in MQTT.

Fixed Fields
Field Name Type Applies To Description
qos integer Publish, Subscribe Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery).
retain boolean Publish, Subscribe Whether the broker should retain the message or not.
bindingVersion string Publish, Subscribe The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.

Example
channels:
  user/signup:
    publish:
      bindings:
        mqtt:
          qos: 2
          retain: true
          bindingVersion: 0.1.0

Message Binding Object

This object contains information about the message representation in MQTT.

Fixed Fields
Field Name Type Description
bindingVersion string The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.

channels:
  user/signup:
    publish:
      message:
        bindings:
          mqtt:
            bindingVersion: 0.1.0