MQTTv3 client disconnected with reason: Sent too many concurrent PUBLISH messages.

HiveMQ 4.3.3 already reached it’s end of life. Please upgrade to a supported version.

 

This only affects HiveMQ version 4.3.3, when a used extension implements the ConnectInboundInterceptor

Observation

An MQTT client using version 3.1 or 3.1.1 gets disconnected with the following statement.

2020-06-08 12:40:12,116 - Client ID: xyz, IP: 1.2.3.4 was disconnected. reason: Sent too many concurrent PUBLISH messages.

Explanation

This is unexpected behaviour and happens when HiveMQ falsely identifies the connection of an MQTTv3 client as an MQTTv5 client.

As a result the Server Receive Maximum of the broker applies to this client and when it sends more in-flight Publishes than this setting allows it gets disconnected.

Reason and solution

A known issue with HiveMQ version 4.3.3 and the ConnectInboundInterceptor causes the mismatch in MQTT version for the client in case any extension used implements that Interceptor class.

Two suitable workaround are:

  1. Decrease the max-inflight-window of the MQTT client to match the server-receive-maximum value of HiveMQ.

  2. Increase the server-receive-maximum value of HiveMQ.

<hivemq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ... <mqtt> <receive-maximum> <server-receive-maximum>10</server-receive-maximum> </receive-maximum> </mqtt> ... </hivemq>

10 is the default value and 65535 is the maximum value.