Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreOn behalf of the community I’m pleased to announce the release of Spring Session 2.0.0.M4. This release is focused primarily on refining WebFlux support. The highlights are:
Configuring Spring Session for WebFlux is simplified to be:
@Configuration
@EnableSpringWebSession
public class HelloWebfluxSessionConfig {
@Bean
public MapReactorSessionRepository reactorSessionRepository() {
return new MapReactorSessionRepository(new ConcurrentHashMap<>());
}
}
You can also switch the strategy for resolving session id’s by simply adding a WebSessionIdResolver
Bean. For example, to switch from using cookies to resolve the session id to using headers, you can use Spring Framework’s new HeaderWebSessionIdResolver
:
@Bean
public HeaderWebSessionIdResolver webSessionIdResolver() {
return new HeaderWebSessionIdResolver();
}
We have added a webflux sample application that demonstrates how to do WebFlux session management.
We also spent some time refining the APIs within Spring Framework’s WebSession
management APIs. While this might not seem important to Spring Session, it ended up letting us delete quite a bit of code within Spring Session which is always a big win!
If you have feedback on this release, I encourage you to reach out via StackOverflow, GitHub Issues, or via the comments section. You can also ping me @rob_winch, Joe @joe_grandja, or Vedran @vedran_pavic on Twitter.
Of course the best feedback comes in the form of contributions.