Skip to content

MQTT support #568

Description

@NotBad4U

Presentation of MQTT

MQTT (Message Queuing Telemetry Transport) is an publish-subscribe-based messaging protocol.
An MQTT system consists of clients communicating with a server, called a broker. A client may be either a publisher of information or a subscriber. Each client can connect to the broker.

Network/Transport layer details

The transport protocol used to carry MQTT 3.1 was TCP/IP. The following are also suitable:

  • TLS
  • WebSocket

Apparently MQTT v3.1 has username/password support at the API level, so you can ensure only authenticated users connect.

broker

There are a lot of mqtt broker implementation e.g.:

The protocol in brief

topics

Topics on a broker are always expected to be "dynamic" and to require no administrative setup.They are arbitrary strings separate by '/' to form an hierarchy (like unix path).
A subscriber can use a wildcard when he want to to subscribe to N topics:

a subscription to A/# is a subscription to the topic A and all topics beneath A
a subscription to A/+ is a subscription to the topics directly beneath, but not A itself
a subscription to A/+/# is a subscription to all topics beneath A, but not A itself

Quality of service (QOS)

MQTT delivers messages according to the levels defined in a Quality of Service (QoS). The levels are described below:

  • 0 = At most once delivery
  • 1 = At least once delivery
  • 2 = Exactly once delivery

Message

The messaging transport is agnostic to the content of the payload (binary, text, ...).

First thoughts: to support MQTT in sozu

  • Sozu could be a reverse proxy for multiples mqtt broker.
  • The proxy should keep the payload of message unparsed.
  • A topic could be an application but the application type in Sozu doesn't have the notion of sub application (for sub topic).
  • The support of QOS can be not needed because this impact the connection between the broker and subscribers.
  • The SSL/TLS support could be done with by reusing the jobs done with rust_tls|rust_openssl ? (Maybe that need a little refactoring)
  • Workers should be able to create a dynamic topic (application) when they discover a new one (Topics on a broker are always expected to be "dynamic") and prevent the master and other works of their creation.

docs:

Activity

  1. added this to the milestone on Jul 29, 2021
  2. removed this from the milestone on Feb 18, 2022
  3. added this to the next milestone on Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions