Skip to content

Consider adding a simple Redis SessionRepository implementation #1278

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

Closed
vpavic opened this issue Dec 4, 2018 · 2 comments
Closed

Consider adding a simple Redis SessionRepository implementation #1278

vpavic opened this issue Dec 4, 2018 · 2 comments
Assignees
Labels
status: superseded An issue that has been superseded by another

Comments

@vpavic
Copy link
Contributor

vpavic commented Dec 4, 2018

A lot of complexity in RedisOperationsSessionRepository is focused around support for Servlet API's HttpSessionEvent. Since many of users do not actually use session events, we can consider providing an alternative, simpler implementation of Redis based SessionRepository that wouldn't support session event handling.

/cc @rwinch

@vpavic vpavic added this to the General Backlog milestone Dec 4, 2018
@vpavic vpavic modified the milestones: General Backlog, 2.2.x Jan 15, 2019
@herveDarritchon
Copy link

👍

I am very very interested in a simpler repo which doesn't use any events/messaging (pub/sub REDIS stuff) because we have Dynomite over REDIS to insure the cross datacente replication and Dynomite doesn't support pub/sub :)
I tried to do it myself but I am stuck in an issue around redefining the sessionRepository bean with my custom implementation.
I ask on gitter and stackoverflow (https://stackoverflow.com/questions/55818188/custom-spring-session-repository-redis-with-dynomite) for help with no solution.
If anyone can help me, it would be great.

I have difficulties to override the sessionRepository implementation from org.springframework.session:spring-session-data-redis with my custom one.

I tried to set up a config class such as :

@Configuration
@EnableRedisHttpSession
public class SessionConfig extends AbstractHttpSessionApplicationInitializer {

    @Bean
    @Primary
    public SessionRepository sessionRepository() {
        return new RedisDynoSessionRepository();
    }
}

And the signature of my Custom Implementation of the SessionRepository is :

public class RedisDynoSessionRepository implements
        FindByIndexNameSessionRepository<RedisDynoSessionRepository.RedisSession> {

I tried to put the override bean configuration (spring.main.allow-bean-definition-overriding=true) or not with no success.

@vpavic vpavic added the type: enhancement A general enhancement label May 1, 2019
@vpavic vpavic self-assigned this May 1, 2019
@vpavic
Copy link
Contributor Author

vpavic commented May 1, 2019

Closing in favor of PR #1408.

@vpavic vpavic closed this as completed May 1, 2019
@vpavic vpavic added status: duplicate A duplicate of another issue and removed Data Store in: redis type: enhancement A general enhancement labels May 1, 2019
@vpavic vpavic removed this from the 2.2.x milestone May 1, 2019
@vpavic vpavic added status: superseded An issue that has been superseded by another and removed status: duplicate A duplicate of another issue labels Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

2 participants