Hi everyone,
I’m sending MQTT data from Kepware IoT Gateway to ThingsBoard. Everything works fine when I publish around 250 tags in a single JSON payload. But when I increase it to 500 tags, the MQTT client in Kepware starts connecting and disconnecting repeatedly, and the message never publishes.
I’m trying to figure out whether this limitation is coming from:
Kepware IoT Gateway’s MQTT Client Agent, or
ThingsBoard’s MQTT broker / MQTT transport,
or simply an MQTT payload size limit on either side.
What I’m seeing:
~250 tags → OK
~500 tags → Kepware repeatedly connects/disconnects
No clear error in Kepware UI
ThingsBoard logs show only connect/disconnect
Behavior suggests a payload or packet size limit
My questions:
Does ThingsBoard MQTT have a max payload or packet size limit?
Does Kepware IoT Gateway restrict MQTT message size?
Is this connect/disconnect loop typical when the payload is too large?
Is splitting tags into smaller groups the recommended approach?
Any insight from users who have handled large MQTT payloads between Kepware and ThingsBoard would be very helpful.
Thanks!
Solved! Go to Solution.
Based on the Kepware Manual I can address your questions regarding Kepware's limitations and configuration options, but I cannot provide details on ThingsBoard's specific limits.
Kepware IoT Gateway Limitations and Configuration:
While the Kepware sources do not specify a hard limit on the total size of an MQTT message payload, they detail how the Kepware MQTT Client Agent manages payload size, which is highly relevant to your issue:
Does Kepware IoT Gateway restrict MQTT message size?
The Kepware IoT Gateway provides a configurable setting to manage the number of tag updates sent in a single transmission, effectively controlling the payload size when using the Narrow Format.
If you are using the Narrow Format, the agent property Max. events per adjusts the number of tag events the gateway packages in a single transmission. An event is defined as a single value change of a single tag configured on that agent.
Is this connect/disconnect loop typical when the payload is too large?
Not necessarily connect / disconnect could be sue to large payload there could be several reasons like, unreachable broker or networking issue, the specific reason can be identified by seeing the Kepware event log.
Is splitting tags into smaller groups the recommended approach?
Based on the available Kepware configuration options, the mechanism for "splitting tags into smaller groups " is achieved by adjusting the Max. events per setting.
Since the 500-tag payload is causing connection failure, reducing the number of events published in a single transmission using the Max. events per setting is the relevant configuration change you can make within Kepware to reduce the size of the payload being published at one time,. This approach directly addresses the implication that the packet size is too large for the network or the receiving broker.
For more Kepware related details I would suggest going through the IoT Gateway Manual.
-Thank You
Kepware Support Team
Based on the Kepware Manual I can address your questions regarding Kepware's limitations and configuration options, but I cannot provide details on ThingsBoard's specific limits.
Kepware IoT Gateway Limitations and Configuration:
While the Kepware sources do not specify a hard limit on the total size of an MQTT message payload, they detail how the Kepware MQTT Client Agent manages payload size, which is highly relevant to your issue:
Does Kepware IoT Gateway restrict MQTT message size?
The Kepware IoT Gateway provides a configurable setting to manage the number of tag updates sent in a single transmission, effectively controlling the payload size when using the Narrow Format.
If you are using the Narrow Format, the agent property Max. events per adjusts the number of tag events the gateway packages in a single transmission. An event is defined as a single value change of a single tag configured on that agent.
Is this connect/disconnect loop typical when the payload is too large?
Not necessarily connect / disconnect could be sue to large payload there could be several reasons like, unreachable broker or networking issue, the specific reason can be identified by seeing the Kepware event log.
Is splitting tags into smaller groups the recommended approach?
Based on the available Kepware configuration options, the mechanism for "splitting tags into smaller groups " is achieved by adjusting the Max. events per setting.
Since the 500-tag payload is causing connection failure, reducing the number of events published in a single transmission using the Max. events per setting is the relevant configuration change you can make within Kepware to reduce the size of the payload being published at one time,. This approach directly addresses the implication that the packet size is too large for the network or the receiving broker.
For more Kepware related details I would suggest going through the IoT Gateway Manual.
-Thank You
Kepware Support Team
As I can see in the event log shot the error : "MQTT agent 'DEV_003' disconnected - reason 'null'
I would suggest going through CS378797 for more details of the error message.
Hi AKshara.
Thanks for your response,
Previously the Max Event Published was set to 1000 due to which it was failing and when i changed it to 100 i am reciving all tags on broker end.
