/
Session Expiry and cleanSession flag

Session Expiry and cleanSession flag

Question

Why does the event.log show statements like the following:

"Client ID: xyz session has expired at TIMESTAMP. All persistent data for this client has been removed."

… for clients that connected with cleanSession=true?
And why is this logged at different times after the client disconnected?
Will the session be re-used, if the client re-connects before the persistent data has been removed by HiveMQ?

Answer

HiveMQ has an internal clean-up job that removed existing, expired data.
In your case (cleanSession) the data expires as soon as the client disconnects and will be cleaned up with the next cleanup. This usually takes between 30 seconds and up to 20 minutes.

The existing data will NOT be re-used, if the client re-connects between a disconnect and the clean-up running through.

Related content

Client Event History performance decreases over time
Client Event History performance decreases over time
More like this
Default Expiry values for Serverless and Starter edition
Default Expiry values for Serverless and Starter edition
More like this
onConnectionLost and onServerInitiatedDisconnect event behavior
onConnectionLost and onServerInitiatedDisconnect event behavior
More like this
Connect and Disconnect Event log message ordering
Connect and Disconnect Event log message ordering
More like this
How are sessions counted in the paid plan?
How are sessions counted in the paid plan?
More like this