Queues

An MQTT broker on your own network.

A MessageBroker is an MQTT broker that runs as an Etorm process on your VPC. Clients on the VPC publish and subscribe on port 1883, and everything the broker knows is kept in an encrypted bucket.

Setting up a broker

A MessageBroker names a VPC and a user. Neither can be changed after creation, so pick the VPC your clients live on.

kind: MessageBroker
metadata: {name: events}
spec:
  vpcRef: {name: lan}         # required; cannot be changed

The short name is mq:

kubectl get mq

The broker's password is generated at creation and shown one time; after that the platform has only a SCRAM-SHA-256 verifier of it. The serving node is a process with an IPv6 address on the VPC, port 1883, and the address is in the resource status. It speaks MQTT 5.0 and 3.1.1.

An MQTT client on a member of the VPC subscribes to a topic filter and receives QoS 1 messages published with the broker's user and password. To try it, start with the quickstart.

Topics, queues and sessions

Inside the broker, topics, queues, sessions and retained messages share one model. Each maps onto an MQTT feature you already know.

ConceptMeaningIn MQTT
TopicFan-out to every matching subscription.Topic name; filters with + and #.
QueueStored. Each message goes to one consumer and is kept until acknowledged.Shared subscription $share/<group>/<filter>.
SessionWho is subscribed to what, and what it has not acknowledged.Client id, Clean Start = 0, session expiry.
Retained messageThe last message of a topic, sent to new subscribers.RETAIN.
AcknowledgementA consumer confirms a message; the stored copy is then deleted.QoS 1 PUBACK.

Delivery and duplicates

The broker does QoS 0 and QoS 1. QoS 2 is not supported.

A QoS 1 publish is acknowledged with PUBACK only after it is committed to the broker's bucket, and the retained update and every stored copy of the message go into that one commit. The message then stays stored until a consumer acknowledges it. If a subscriber's connection drops first, the message is delivered again after the reconnect. That makes QoS 1 at least once, so a message can arrive more than once and your consumers should be able to handle the same message twice. With QoS 0, delivery is at most once.

One node and its bucket

Sessions, subscriptions, queued and retained messages all live in the broker's bucket, so the node holds nothing that cannot be rebuilt from it. That is also why a QoS 1 publish waits for a commit to the bucket before it is acknowledged.

All of a broker's state has a single writer, the node that serves clients. So one node carries every client of the broker, and you should plan your load on a broker with that in mind.

Deleting a MessageBroker removes its process and its bucket, and destroys the bucket's keys. The state cannot be read again.

Protocol limits

PropertyValue
ProtocolsMQTT 5.0 and 3.1.1, port 1883.
DeliveryQoS 0 and 1. QoS 1 delivery is at least once. QoS 2 is not supported.
MQTT featuresWill messages, topic aliases, flow control and message expiry are not supported.
Topic names1 to 1 024 bytes.
PayloadsUp to 1 MiB.
NodesOne node serves every client of the broker.
VPC and userCannot be changed after creation.

The broker node is a Compute process; the architecture page has the Compute details.

Request access