Open TMRGZ opened 4 days ago
Thanks for the report.
The missing support for spring.session.redis.configure-action
looks like an oversight. Support was added to Spring Session in 3.3 to which we upgraded in Spring Boot 3.3. We'll have to discuss this as a team to see if we want to treat adding support as enhancement or as a bug of omission.
As far as I can tell, spring.session.redis.namespace
is already supported when using a reactive session repository:
This functionality was added when we started supporting reactive in Spring Boot 2.0.
Can you please clarify what you believe to be missing from the reactive session support beyond spring.session.redis.configure-action
?
That config works when the default reactive redis session repository is used, but since to use the indexed one you have to use the @EnableRedisIndexedWebSession annotation it's ignored and uses the configurations provided in the annotation.
I'll clarify that this affects only the reactive indexed repository
As noted in the Spring Session configuration documentation, reactive indexed repositories can only be enabled through annotations, which limits the configuration flexibility via application.properties.
https://docs.spring.io/spring-session/reference/configuration/redis.html
https://docs.spring.io/spring-session/reference/configuration/reactive-redis-indexed.html
Additionally, the auto-configuration classes do not account for important properties such as configureRedisAction and namespace.
https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/RedisSessionConfiguration.java
https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/RedisReactiveSessionConfiguration.java
Simply adding the equivalent methods resolves this issue, as shown in the following configuration:
Additionally, it would be helpful to add a similar check for non-indexed repositories when the cleanup-cron property is enabled.
I can provide a PR if needed