It is possible to change(force) the client clean session configuration via the Mosquitto Plugin?

Hi everyone,

Is there any method available in the mosquitto plugin’s public interface to set a client’s clean session configuration (similar to mosquitto_set_username - mosquitto_broker.h)?

My usage scenario consists of not allowing the use of persistent clients, but I would not like to deny a connection, but just “force” the clean session configuration of the clients that connect to the broker to true.

If there is any other way to resolve this question, I am open to suggestions.

Thanks for the great job ever with Mosquitto(the best MQTT broker).

1 Like

Hi Thiago,

That’s not possible at the moment, but I think it should be. I’ll try to remember to post here when I’ve implemented it, so you can test it out.



1 Like

Hi Roger, thank you very much for the reply.

Normally I follow the repository on github and I can also check when there’s something new.

Another question and/or suggestion that might go along the same line is related to having access via plugin to the information on the LWT (last will testament) informed by the client.

In my scenario, for example, it would be interesting to validate some specific details of this type of message (such as the definition of the LWT topic). I apologize if this is already possible or if it doesn’t make sense, but the question remains.