MQTT broker behavior on TTN / The Things Stack

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:

  1. 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)?

  2. 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?

  3. 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?

  4. Can you share best practices or recommendations when connecting a third-party integration client (ThingsBoard) to TTN over MQTT to avoid duplicates?

Who, me? I’m just a volunteer, just like everyone else on here.

This is the TTN Community forum for the Sandbox free-to-use Test edition, not a direct line to TTI support. So you may want to look at your questions through the lens of it being a shared global free system with 10,000’s of users. How feasible would it be if each user asked for such setup & access to the logs.

Maybe talk to the ThingsBoard about deduplicating messages. Or use the web hook which is far less load on the TTN servers and I’ve never seen duplicated messages on it.

You may well benefit from using a TTI instance with support plan, @rish1 will be able to assist.

Sorry, I had prepared that message to send it to TTN and that’s what I did. I also opened this question here in the forum in case someone could answer it. I didn’t realize I needed to change that part of the message — obviously this is a public forum and nobody here has any responsibility over it.

THIS is TTN - the Community edition.

TTI are deeply unlikely to answer unless you have a support plan.

And are likely to want you to be using a TTI instance even if you do pay for support, as TTN is not setup for this sort of activity.