Does vertx-web support session that stored in Redis? Or I have to implement it by myself?
I find that vertx-web support LocalSessionStore and ClusteredSessionStore, I want to stored my session in Redis. So is there any suggestion how to implement it, or is there some frameworks, libraries that I can use?
@XiaohuChen the vertx-web maintainer @pmlopes would like to have an implementation of Vert.x Web session store backed by Redis. If you are willing to contribute it, it will be reviewed and maintained by the Vert.x Web developers.
OK, I will try to contribute
Several years ago I wrote a redis session store for yoke. You can see it here: https://github.com/pmlopes/yoke/blob/2.0.21/store/redis/src/main/java/com/jetdrone/vertx/yoke/store/RedisSessionStore.java this could be the start of this contributions
There is a problem that the get method declared in io.vertx.ext.web.Session is synchronous. I think if using redis-client, the get method should be an asynchronous call. Is there any good solution?
@aruis then we need to break the API as it does not make sense to by synchronous
@aruis I'll try to quickly prototype a barebones session storage that relies on a HTTP Cookie, that could be the starting point for other implementations, WDYT?
@pmlopes I haven't understood your intention yet. If you already have a project address on github, I'd be very happy to take a look.Thanks.
this seems to be Redis session store implementation https://segmentfault.com/a/1190000009470700
@Mart-Bogdan That doesn't work. I actually tested it with his program. Although the author also wrote unit tests, he didn't notice the core problem. I mentioned the above.
@Mart-Bogdan @aruis the work to support this has been merged, as a PoC there's is a open PR showing how to create custom storages (using in this case a plain cookie) https://github.com/vert-x3/vertx-web/pull/999
From here it would be just add an implementation for redis.
Support for redis session storage has landed on master.
Most helpful comment
Support for redis session storage has landed on master.