Skip to content
Stand with Ukraine flag

Application shared subscriptions

The Application Shared Subscription entity enables the Shared Subscriptions feature for APPLICATION clients, allowing multiple clients to subscribe and receive messages from a shared subscription.

  • Create an Application Shared Subscription entity when you plan to use shared subscriptions with APPLICATION clients.
  • After creation, the Topic filter and Partitions fields cannot be changed.
  • Shared subscriptions work with MQTT 5 and earlier versions.

Administrators can manage shared subscriptions via the Web UI or REST API.

  1. Open Shared subscriptions → Application entities in the left-hand menu and click the plus icon.
  2. Fill in the following fields:
    • Name — any display name, e.g., “Application Shared Subscription”.
    • Topic filter — the actual MQTT topic filter (wildcards # and + are supported). If your full shared subscription topic filter is $share/group1/city/+/home/#, set this field to city/+/home/#. Cannot be changed after creation and must be unique.
    • Partitions — set to equal or a multiple of the expected number of subscriber clients for even load distribution. For example, if 5 clients will subscribe, use 5, 10, or 15. Cannot be changed after creation.
  3. Click Add.

After creation, a dedicated Kafka topic is created using the following naming convention:

MQTT topic filter Kafka topic
test/topic tbmq.msg.app.shared.test.topic
test/# tbmq.msg.app.shared.test.mlw
test/+ tbmq.msg.app.shared.test.slw

Where /., #mlw (multi-level wildcard), +slw (single-level wildcard).

If the topic filter contains characters other than letters, digits, /, +, and #, a SHA-256 hash of the filter is used instead:

tbmq.msg.app.shared.$TOPIC_FILTER_HASH

This behavior is controlled by TB_APP_PERSISTED_MSG_SHARED_TOPIC_VALIDATION (enabled by default). When disabled, the character replacement is applied without validation, so a topic filter with special characters may produce an invalid Kafka topic name.

Two actions in the top right corner of the page manage the Kafka topics of all Application Shared Subscriptions at once:

  • Sync Kafka topics — creates the missing Kafka topics; existing topics are kept.
  • Delete Kafka topics — permanently purges the Kafka topics of all Application Shared Subscriptions and may disrupt message flow. Shown only when Kafka topic deletion is enabled.

Only the Name field can be edited after creation.

  1. Click on the shared subscription row.
  2. Click the Toggle edit mode button (pencil icon).
  3. Modify the name and click Apply changes.
  1. Delete single — click the Delete icon in the corresponding row, or open the entity and click the Delete button.
  2. Delete multiple — select multiple items using checkboxes, then click the Delete icon in the top right corner.