thingsboard / tbmq

Open-source, scalable, and fault-tolerant MQTT broker able to handle 4M+ concurrent client connections, supporting at least 3M messages per second throughput per single cluster node with low latency delivery. The cluster mode supports more than 100M concurrently connected clients.
https://thingsboard.io/products/mqtt-broker/
Apache License 2.0
570 stars 46 forks source link

[Bug] MQTT 5: max payload size response #93

Closed dmytro-landiak closed 7 months ago

dmytro-landiak commented 7 months ago

Describe the bug

When the MQTT 5 client is connecting, the wrong Maximum Packet Size is returned. Based on the code, the min value between tcp and ssl listeners is returned:

Math.min(tcpMaxPayloadSize, sslMaxPayloadSize)).

In this way, if the ssl communication is used and tcp has lower value, then this lower value is returned for ssl but it should be greater.

The correct behavior is when the single max payload size can be set for all listeners or separate ones for each of them.

Your Server Environment