For the complete documentation index, see llms.txt. This page is also available as Markdown.

Duplicate Message Delivery in MQTT Clients

Configure duplicate message delivery behavior in CybusMQ for overlapping MQTT subscriptions.

When a client subscribes to multiple topics that can match the same published message (e.g., using wildcards), CybusMQ can be configured to either:

  • Send a single message (deduplication enabled, default behavior)

  • Send multiple messages (deduplication disabled)

Use Cases

  • Enabled deduplication: Ensures that each client processes a message only once, regardless of subscription patterns.

  • Disabled deduplication: When your application specifically requires receiving multiple copies of messages for overlapping subscriptions, such as certain protocol-mapping scenarios.

Example

A client subscribes to +/bar and foo/bar:

  • The wildcard subscription +/bar matches any topic with a single-level prefix followed by /bar.

  • The specific subscription foo/bar matches only the exact topic foo/bar.

When a message is published to foo/bar, both subscriptions match this topic.

  • With deduplication enabled:

Client receives: 1 message
{
  "topic": "foo/bar",
  "payload": "Hello World"
}
  • With deduplication disabled:

Enabling/Disabling Deduplication

By default, CybusMQ deduplicates messages for overlapping subscriptions. This means a client will receive only one copy of a message even if multiple subscriptions match the published topic.

To allow clients to receive multiple copies of the same message when they have overlapping subscriptions, you can disable deduplication.

Enabling/Disabling Deduplication on Kubernetes

Prerequisite

  • Your Helm chart is version 1.5.0 or later.

Procedure

  1. Open your values.yaml file.

  2. Set the DOCKER_VERNEMQ_DEDUPLICATE_OVERLAPPING_SUBS to on (enable) or off (disable).

Last updated

Was this helpful?