Skip to content

Shared subscriptions Available for Paid Plans ​

With a normal subscription every subscriber gets every message. With a shared subscription, the subscribers share the work: each message goes to only one of them. Use it to scale a back-end consumer horizontally.

Syntax ​

text
$share/<group>/<topic filter>

Example: three instances of a service subscribe to $share/ingest/acme/+/+/+/+/telemetry. Each telemetry message goes to one of the three, so together they handle three times the load, and when one stops, the others take over its share.

How ConnectMQ distributes messages ​

  • Messages are handed out round robin among the connected members.
  • All shared subscriptions to the same topic filter in your organization form one group, whatever group name they use. $share/ingest/… and $share/archive/… on the same filter therefore share the messages between them instead of each receiving all of them. If two different applications need every message, give one of them a normal subscription, or use slightly different filters.
  • Retained messages are not sent to shared subscriptions when they subscribe.
  • Normal subscriptions to the same topic still receive every message, next to the shared group.

Availability ​

FreeBasicScale
Shared subscriptions—YesYes

On the Free plan a $share/… subscription is refused with 0x97 Quota exceeded in the SUBACK. The public test broker accepts shared subscriptions for experiments. Shared subscriptions are an MQTT 5 feature; use an MQTT 5 client.

Rules ​

  • The filter after the group may use wildcards.
  • No Local cannot be used with shared subscriptions (SUBACK 0x83).
  • An invalid format such as a missing filter is refused with 0x8F.
  • ACL rules apply to the filter after $share/<group>/.

Fully managed MQTT broker for connected devices.