-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add support for configuring Spring Session Redis repository #32205
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
Conversation
@@ -2757,6 +2757,20 @@ | |||
"name": "spring.session.redis.flush-mode", | |||
"defaultValue": "on-save" | |||
}, | |||
{ | |||
"name": "spring.session.redis.repository", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't 100% sure how to name this property, so I initially went with the simple option. Alternatively, this could maybe be named spring.session.redis.repository-type
.
"description": "Redis session repository implementation to use.", | ||
"values": [ | ||
{ | ||
"value": "default", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RedisSessionRepository
by itself doesn't offer much inspiration on how to name this other than default
or maybe basic
.
"description": "Use default Redis session repository." | ||
}, | ||
{ | ||
"value": "indexed", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTOH, RedisIndexedSessionRepository
makes this quite straightforward. One might get tempted to throw mention of events here as well (based on soon to be removed EnableRedisHttpSession#enableIndexingAndEvents
) however I'd avoid that as support for session events is an implementation detail of a session repository (and not something expressed through a contract, like indexing capabilities).
With Spring Session moving to RedisSessionRepository as the preferred session repository, Spring Boot auto-configuration should make it possible to easily switch back to the previous default (RedisIndexedSessionRepository). This commit introduces spring.session.redis.repository configuration property that allow selecting the desired Redis-backed session repository implementation. Closes spring-projectsgh-30673
@vpavic I see you just force-pushed. What did you change? I was just in the process of getting this ready to merge and I don't want to miss something. |
Hey @wilkinsona, sorry I had intended to drop a note here after force pushing but forgot to do so in the end. Nothing changed, I just rebased the branch as it was few hundred commits behind and also wanted to verify everything works as expected with the changes that were shipped with the latest Spring Session milestone yesterday. |
With Spring Session moving to RedisSessionRepository as the preferred session repository, Spring Boot auto-configuration should make it possible to easily switch back to the previous default (RedisIndexedSessionRepository). This commit introduces spring.session.redis.repository configuration property that allows selecting the desired Redis-backed session repository implementation. See gh-32205
I just tried the snapshots and this works (fails?) very nicely indeed. Very useful. |
With Spring Session moving to
RedisSessionRepository
as the preferred session repository, Spring Boot auto-configuration should make it possible to easily switch back to the previous default (RedisIndexedSessionRepository
).This commit introduces
spring.session.redis.repository
configuration property that allow selecting the desired Redis-backed session repository implementation.Closes #30673