MQTT Disconnect


I wanted to know how the disconnect aspect of the MQTT Gatling tests work. I see that there is no dedicated disconnect command for “disconnect” and so I wanted to know how it works under the hood to understand my results.


Each virtual user has its own MQTT connection.
When a user terminates its scenario, it automatically sends a DISCONNECT message, then closes the connection.

Thanks for getting back to me! The reason that I ask is that I see that the “Concurrent Users” section of Enterprise never seems to go down. That seems to indicate that maybe those devices are not being disconnected.

Please check the User termination rate chart to figure out how many devices are getting disconnected.
If it looks abnormal, please check your injection profile and your scenario design (eg infinite/long loops).

For the scenario in question, when I do just a connect, it works fine I see that all the users are getting terminated. But when I perform a publish, I see that the message is published but none of the users are being terminated. Our publish function does not send out a response, so would it be possible to set the QOS to 0. I did use the qosAtMostOnce, but that didn’t seem to help.

Please open a support ticket and share a reproducer.