I am working with ThingsBoard (version 4.0.1) and integrating it with TTN (The Things Stack) via MQTT. However, we are facing a recurring issue where duplicate messages arrive in our ThingsBoard integrators. Because the broker (TTN) is managed by you, we have almost no control over its internal behavior, and we’re trying to understand whether any broker-side settings can be adjusted to mitigate this problem.
Here is a summary of our situation:
-
We have multiple MQTT integrations configured in ThingsBoard, each subscribing to topics in TTN.
-
The duplicate messages arrive randomly, not always in the same integration or at the same time.
-
We observed many concurrent connections from our ThingsBoard instance toward TTN’s MQTT broker (on port 1883 / or TLS).
-
Because TTN acts as the broker we connect to, we cannot modify
clientId
,clean session
, or internal broker settings from our side. -
Our suspicion is that TTN might be doing reconnections, replays, or other broker behavior that lead to messages being delivered more than once.
My main questions are:
-
What configurable broker behavior (if any) does TTN / The Things Stack allow that could affect duplicate message delivery (e.g. session persistence, replay buffer, reconnection policies, QoS internal handling)?
-
Is it possible to limit or throttle the number of concurrent MQTT connections from a client or enforce a single session per
clientId
on the TTN broker side? -
Are there logs on the broker side that I can request (or access) to trace how many times a message is published or replayed to clients?
-
Can you share best practices or recommendations when connecting a third-party integration client (ThingsBoard) to TTN over MQTT to avoid duplicates?