# Reconnect and QoS

**URL:** <https://forum.cedalo.com/t/reconnect-and-qos/1268>\
**Category:** Errors\
**Created:** [September 14, 2026, 2:57pm UTC](https://forum.cedalo.com/t/reconnect-and-qos/1268 "2026-09-14T14:57:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/ofm/32/663_2.png) [@ofm](https://forum.cedalo.com/u/ofm)\
**Post date:** [September 14, 2026, 2:57pm UTC](https://forum.cedalo.com/t/reconnect-and-qos/1268/1 "2026-09-14T14:57:24Z")

</div>

Hi, I’m using libmosquitto with Solace MQTT broker, MQTTv5. Works great except for when the Solace brokers are restarted for any reason. When reconnecting the same session, Solace seems to accept new connections prematurely often returns `CONNACK` with reason code 133 “Client Identifier not valid”, when this happens also property 36, `MQTT_PROP_MAXIMUM_QOS`, is passed with value zero. If I disconnect, and tries to reconnect on a random backoff this property is never sent again, even when `CONNACK` reason\_code is `MQTT_RC_SUCCESS`.

The MQTTv5 standard allows this, only QoS 0 or 1 needs to be sent, else 2 is assumed. However, the value `max_qos` in the opaque struct is never reset to 2. Setting it to 2 before reading the properties in lib/handle\_connack.c would fix the problem. Where I am now, all I can do is `assert(reason_code != MOSQ_ERR_QOS_NOT_SUPPORTED)` which is safe but hardly ideal, at least not pretty in the Grafana logs 😛.  
Any suggestions/better way to go about this than making changes in my copy of libmosquitto?
