Remove Embedded Redis
Fixes gh-248
This commit is contained in:
@@ -19,27 +19,22 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
|
||||
import org.springframework.session.redis.embedded.RedisServerPort;
|
||||
import org.springframework.session.web.http.HeaderHttpSessionStrategy;
|
||||
import org.springframework.session.web.http.HttpSessionStrategy;
|
||||
|
||||
// tag::class[]
|
||||
@Configuration
|
||||
@EnableEmbeddedRedis // <1>
|
||||
@EnableRedisHttpSession // <2>
|
||||
@EnableRedisHttpSession // <1>
|
||||
public class HttpSessionConfig {
|
||||
|
||||
@Bean
|
||||
public JedisConnectionFactory connectionFactory(@RedisServerPort int port) {
|
||||
JedisConnectionFactory factory = new JedisConnectionFactory(); // <3>
|
||||
factory.setPort(port);
|
||||
return factory;
|
||||
public JedisConnectionFactory connectionFactory() {
|
||||
return new JedisConnectionFactory(); // <2>
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpSessionStrategy httpSessionStrategy() {
|
||||
return new HeaderHttpSessionStrategy(); // <4>
|
||||
return new HeaderHttpSessionStrategy(); // <3>
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
Reference in New Issue
Block a user