3

In my Spring Boot 2.7.4 project, I use Spring Session with Redis by including these dependencies:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
            <version>${spring-boot-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.session</groupId>
            <artifactId>spring-session-data-redis</artifactId>
        </dependency>

This, along with a handful of application property settings to specify host, port, etc., this works fine.

Setting the following property allows Spring Session to be switched off. This is very convenient when running the service in an IDE in a development environment, for example, where you may not have access to a running Redis instance.

spring.session.store-type=NONE

However, I have just upgraded to Spring Boot 3.0.4 and have found that this property is no longer supported. I would be very grateful if anyone can suggest an alternative way to switch off Spring Session for development work, while still leaving the dependencies and configuration in place ready for formal deployments.

Jon H
  • 394
  • 3
  • 17

1 Answers1

0

According to Spring Boot 3.x Migration Guide

You can define your own SessionRepository bean and cause the auto-configuration to back off.

Andrei Lisa
  • 1,361
  • 3
  • 11