spring-projects / spring-projects/spring-session
Possible to Disable Spring Session Without Compiling?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Hi, I'm implementing Spring Session/Spring Data Redis in an application that will be deployed in environments that may or may not have a Redis repository configured, and therefore in the latter case the standard HttpSession functionality provided by the web server should be used instead.
I'm using a Java-based Spring Session configuration for the implementation, which includes creating an Initializer subclass that inherits AbstractHttpSessionApplicationInitializer, which itself is an implementation of WebApplicationInitializer. This means my Spring Session Initializer class will always be executed upon application deployment, which is not always desirable in my use case.
Is there some way to disable Spring Session that can be toggled via something external to the application (i.e. an environment property, etc)? I tried using the Spring @Conditional mechanism on the Initializer class, but this does not work as the annotation is not acknowledged when applied to subclasses.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Java-based Initializer subclass and AbstractHttpSessionApplicationInitializer, including how WebApplicationInitializer classes are discovered and run. Determine whether an external setting can prevent Spring Session initialization while preserving standard HttpSession behavior; done requires an agreed design and documented configuration path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100