Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
112 lines (77 sloc) 3.45 KB

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.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 how hard the broker/client will try to ensure that a message is received. Its value MUST be either 0, 1 or 2.
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
You can’t perform that action at this time.