Skip to content

Restructure Redis HttpSession configuration support #2123

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

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Aug 16, 2022

This PR reverts 8582b97 and restructures configuration support for Redis-backed HttpSession with aim to enable users to easily select the SessionRepository implementation they prefer to use.

This is achieved by introducing @EnableRedisIndexedHttpSession annotation that can be used to configure RedisIndexedSessionRepository, while the existing @EnableRedisHttpSession will going forward configure RedisSessionRepository as the SessionRepository implementation used by Spring Session.

Additionally, this also introduces AbstractRedisHttpSessionConfiguration as the base configuration class that manages common aspects of Redis-backed HttpSession support, which is then extended by more specific configuration classes that provide specific SessionRepository implementation.

Closes #2122

@vpavic vpavic force-pushed the redis-httpsession-config branch 5 times, most recently from be49463 to 7916f8f Compare August 29, 2022 13:20
@vpavic vpavic changed the title WIP: Restructure Redis HttpSession configuration support Restructure Redis HttpSession configuration support Aug 29, 2022
@vpavic vpavic marked this pull request as ready for review August 29, 2022 13:22
@vpavic vpavic force-pushed the redis-httpsession-config branch from 7916f8f to 6c8fd80 Compare August 31, 2022 05:37
Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @vpavic! Overall it looks good. Can you please rebase and add documentation for the new annotations?

This commit restructures configuration support for Redis-backed
HttpSession with aim to enable users to easily select the
SessionRepository implementation they prefer to use.

This is achieved by introducing [at]EnableRedisIndexedHttpSession
annotation that can be used to configure RedisIndexedSessionRepository,
while the existing [at]EnableRedisHttpSession will going forward
configure RedisSessionRepository as the SessionRepository implementation
used by Spring Session.

Additionally, this also introduces AbstractRedisHttpSessionConfiguration
as the base configuration class that manages common aspects of
Redis-backed HttpSession support, which is then extended by more
specific configuration classes that provide specific SessionRepository
implementation.

Closes spring-projectsgh-2122
@vpavic vpavic force-pushed the redis-httpsession-config branch from 6c8fd80 to e1757d2 Compare September 7, 2022 14:08
@vpavic
Copy link
Contributor Author

vpavic commented Sep 7, 2022

I've rebased the PR on top of the current main.

I considered the documentation updates while putting the PR together, however with all the changes that happened during the lifecycle of 2.x (that were unfortunately not documented in timely manner) and now these changes I feel that the docs are better addressed via #1010 as a part of larger overhaul. That's one topic I believe we should discuss when we jump on the next sync.

In the meantime, I wouldn't hold this up, especially since spring-projects/spring-boot#32205 is likely to get merged soon as well.

@rwinch rwinch self-assigned this Sep 7, 2022
@rwinch rwinch added this to the 3.0.0-M3 milestone Sep 7, 2022
@rwinch rwinch merged commit e050a92 into spring-projects:main Sep 7, 2022
@vpavic vpavic deleted the redis-httpsession-config branch September 7, 2022 20:50
@rwinch rwinch added the type: enhancement A general enhancement label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: redis type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restructure Redis HttpSession configuration support
2 participants