Add Redis implementation of ReactorSessionRepository

Closes gh-816
This commit is contained in:
Vedran Pavic
2017-08-11 07:59:49 +02:00
parent 9f5f7540d2
commit 19b8effa41
12 changed files with 1368 additions and 14 deletions

View File

@@ -16,22 +16,19 @@
package sample;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.EnableSpringWebSession;
import org.springframework.session.MapReactorSessionRepository;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.reactor.EnableRedisReactorSession;
@Import(EmbeddedRedisConfig.class)
// tag::class[]
@Configuration
@EnableSpringWebSession
@EnableRedisReactorSession
public class HelloWebfluxSessionConfig {
@Bean
public MapReactorSessionRepository reactorSessionRepository() {
return new MapReactorSessionRepository(new ConcurrentHashMap<>());
public LettuceConnectionFactory lettuceConnectionFactory() {
return new LettuceConnectionFactory();
}
}
// end::class[]