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.