Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]Session expiration implementation #101

Open
friesendrywall opened this issue Jul 8, 2022 · 1 comment
Open

[question]Session expiration implementation #101

friesendrywall opened this issue Jul 8, 2022 · 1 comment
Labels

Comments

@friesendrywall
Copy link
Contributor

friesendrywall commented Jul 8, 2022

MQTT 5 allows session expiration, so at some point if someone decides to move ahead with implementation, the persistence modules will need some work done. At present I'm considering incorporating it into a MQTT 5 server I've been working on.

What would the roadmap be for this to happen, would the work have to start with aedes-cached-persistence, or would it have start with the individual persistences?

As an alternate, I suppose a person could do a plugin similar to the way the aedes-stats plugin works, but that may be problematic if the internals of the persistences change.

The way I'd see it, it could be separate api calls, or integrated, but essentially I'd be thinking something like:

sessionStart(clientId)
sessionRefresh(clientId) // Reset the session expiration
expiredSessions() // the broker would clear expired sessions based on returned items (client and client:* keys)

For redis I'm thinking about using a sorted set with value = clientId, score = expiration.

@robertsLando
Copy link
Member

This needs to be implemented on aedes-persistence first and then aedes-cached-persistence and at last on all other persistences. The plugin way isn't good IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants