mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

MQTT 5 / mosquitto_sub / unexpected Recive Maximum Property

Open JSchy65 opened this issue 3 years ago • 3 comments

mosquitto_sub client version 2.0.14 (Ubuntu 20.04)

The CONNECT Properties contain an unexpected Recive Maximum Property value.

mosquitto_sub -p 1883 -q 1 -t test/# -c -i abc123 -x 30 -D connect maximum-packet-size 1000000 -d

CONNECT Properties: 0d 27 00 0f 42 40 11 00 00 00 1e 21 00 14

maximum-packet-size (27) and session-expiry-interval (11) are set as expected.

But there is also a Recive Maximum (21) property set to 14hex even it was not explicitely set within the command. The MQTT 5 Specification says in chapter 3.2.2.3.3 that the default value for the receive maximum is 65535. Is it intendet to set it to 14hex ??

By the way:

In my oppinion, it would be very helpful to explicitely state in the mosquitt_sub manual that the -x option alone has no effect and that it must be combined with a -D property to get any effect. I lost hours to find that out.

The note "Applies to MQTT v5 clients only" is a litte bit to hided :-)

Anyway, that -x in my opinion is not a good idea. "-D connect session-expiry-interval" would be the right way. But then you get that "Error in CONNECT properties: Duplicate property in property list".

My recommendation here is to fix that "duplicate property" problem and forget that unlucky -x.

Thank You very much, Regards Joachim Schachermayer

JSchy65 avatar Aug 12 '22 10:08 JSchy65

-x - I've changed this to enable MQTT v5.0 mode if it is used. I won't be getting rid of the option, it's an important one so should be easily accessible.

receive-maximum is set to a sensible default by the client, if you don't otherwise set it.

ralight avatar Aug 12 '22 14:08 ralight

To set the receive-maximum to that small value is intentendet as I understood yor answer . Thats fine for me. I only wanted to make sure that it was intended and not by error.

JSchy65 avatar Aug 17 '22 13:08 JSchy65

If the -x enables the MQTT v5.0 mode, that is a really great idea I like very much.

But I have retested with 2.0.15 now and the behaviour of the mosquitto_sub is the same like before. That means that the -x alone is not enabling the MQTT v5.0 mode.

From the GIT Insights Network Graph I found, that the commit e5cb3d0 from 12. Aug. implements that but still exists only in the develop branch and was not taken over to the master and/or fix branch. This is a pity ;-)

Hopefully, one day that commit will also find its way into a release :-)

JSchy65 avatar Aug 17 '22 13:08 JSchy65

I don't like to change behaviour across bug fix releases where possible, so the -x behaviour won't change until 2.1. I believe everything else is addressed, so I'm closing this issue.

ralight avatar Apr 10 '23 21:04 ralight