hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
860 stars 159 forks source link

Log a warning when client omits User Properties due to packet size over limit #535

Open MicWalter opened 2 years ago

MicWalter commented 2 years ago

Problem or use case

As in accordance with the spec the client omits the User Properties(UP) if adding them would increase the packet size over the allowed limit set by the server. The current problem is that this happens silently and there is no way to inform the user that the UPs were omitted.

One example from spec:

The sender MUST NOT send this property if it would increase the size of the DISCONNECT packet beyond the Maximum Packet Size specified by the receiver [MQTT-3.14.2-4]

Preferred solution or suggestions

Simplest solution: Add a WARN log when the client omits the UPs.