Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load the site search from Google. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics).

Remember the campaign or partner link you arrived from, so we know which campaign or partner brought you when you sign up or contact us (partner program). We do not use it to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

776 Try for free Menu

TBMQ live demo

Try TBMQ in your browser

A free account on our public broker. Open the TBMQ UI and connect your MQTT clients. No credit card required.

Rather run it yourself? Install on your own servers

Subscriptions

In MQTT, a subscription is a mechanism that allows clients to receive messages directed to specific topics. When a client subscribes to a topic, it expresses its interest in receiving all messages published to that topic.

The Subscriptions page lets you observe, analyze, and filter all subscriptions on the broker. The table contains the following information about each subscription:

  • Client ID — the identifier of the client that owns the subscription.
  • Topic filter — the MQTT topic filter.
  • QoS — Quality of Service of the subscription.
  • No Local — when true, the broker will not forward messages from this client back to the connection on which this subscription was made.
  • Retain as Published — when true, messages forwarded using this subscription keep the RETAIN flag they were published with.
  • Retain Handling — how the broker handles retained messages when the client subscribes:
    • 0 — send retained messages at subscription time.
    • 1 — send retained messages at subscription time if the subscription does not already exist.
    • 2 — do not send retained messages at subscription time.
  • Subscription ID — the numeric identifier (1 to 268,435,455) the client assigned to the subscription when subscribing. The broker includes it in every PUBLISH message that matches the subscription, so the client can identify which subscription the message was matched against.

No Local, Retain as Published, Retain Handling, and Subscription ID are MQTT 5 subscription options. For MQTT 3.x clients, the table shows their default values: false, false, 0, and an empty Subscription ID.

Subscriptions can be filtered by any combination of these fields using the filter above the table.

You can add, remove, or edit subscriptions from the Session details window:

  1. Open the Subscriptions page in the left-hand menu.
  2. Click on a table row to open the session subscriptions details.
  3. Add, edit, or delete client subscriptions.
  4. Click Update to save changes.

Subscriptions are stored in memory using a Trie data structure, which enables efficient topic-based message routing. The Trie organizes topic filters hierarchically — each node represents a topic level — allowing the broker to quickly locate matching subscriptions for any published message.

When a client unsubscribes, the broker removes the data and marks the node as empty. Over time, many deleted subscriptions leave empty nodes in memory, causing inefficiencies and wasting resources.

Clearing empty subscription nodes frees memory and improves subscription matching performance.

To clear empty subscription nodes, click the Clear empty subscription nodes button (trash icon) in the top right corner and confirm the action.

The broker also clears empty subscription nodes on a schedule, controlled by the environment variables MQTT_SUB_TRIE_CLEAR_NODES_CRON (default 0 0 0 * * * — every day at midnight) and MQTT_SUB_TRIE_CLEAR_NODES_ZONE (default UTC).