Reactive in Spring Session

Another significant update in the Spring Framework, which is related to the Spring Web module, is reactive support in the Spring Session module. 

Now we get support for the WebFlux module so that we may employ an efficient abstraction for session management. For that purpose, Spring Session introduces ReactiveSessionRepository, which enables asynchronous, nonblocking access to the stored session with the Reactor's Mono type.

Apart from that, Spring Session offers reactive integration with Redis as session storage over reactive Spring Data. In this way, we may achieve a distributed WebSession just by including the following dependencies:

compile "org.springframework.session:spring-session-data-redis"
compile "org.springframework.boot:spring-boot-starter-webflux"
compile "org.springframework.boot:spring-boot-starter-data-redis-reactive"

As we can see from the preceding Gradle dependencies example, in order to achieve reactive Redis WebSession management, we have to combine those three dependencies in one place. In turn, Spring Boot takes care of providing an exact combination of beans and producing a fitting autoconfiguration in order to run the web application smoothly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.163.238