diff --git a/docs/src/docs/asciidoc/guides/boot.adoc b/docs/src/docs/asciidoc/guides/boot.adoc index e7e30677..486fc227 100644 --- a/docs/src/docs/asciidoc/guides/boot.adoc +++ b/docs/src/docs/asciidoc/guides/boot.adoc @@ -75,9 +75,21 @@ include::{samples-dir}boot/src/main/java/sample/config/HttpSessionConfig.java[] <1> The `@EnableRedisHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements Filter. The filter is what is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance Spring Session is backed by Redis. -<2> Spring Boot automatically creates a `RedisConnectionFactory` that connects Spring Session to the Redis Server. -In our example, we are connecting to localhost on the default port (6379). In a production environment you need to ensure to configure your JedisConnectionFactory bean to point to your Redis instance. -For more information on configuring Spring Data Redis, refer to the http://docs.spring.io/spring-data/data-redis/docs/current/reference/html/[reference documentation]. + +[[boot-redis-configuration]] +== Configuring the Redis Connection + +Spring Boot automatically creates a `RedisConnectionFactory` that connects Spring Session to the Redis Server. +In a production environment you need to ensure to update your configuration to point to your Redis server. For example, you can include the following in your *application.properties* + +.src/main/resources/application.properties +---- +spring.redis.host=localhost +spring.redis.password=secret +spring.redis.port=6379 +---- + +For more information, refer to http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-connecting-to-redis[Connecting to Redis] portion of the Spring Boot documentation. == Servlet Container Initialization diff --git a/samples/boot/src/main/java/sample/config/HttpSessionConfig.java b/samples/boot/src/main/java/sample/config/HttpSessionConfig.java index 25c3b7be..0a424266 100644 --- a/samples/boot/src/main/java/sample/config/HttpSessionConfig.java +++ b/samples/boot/src/main/java/sample/config/HttpSessionConfig.java @@ -1,11 +1,6 @@ package sample.config; -import org.springframework.context.annotation.Configuration; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; +import org.springframework.session.data.redis.config.annotation.web.http.*; -@Configuration @EnableRedisHttpSession // <1> -public class HttpSessionConfig { - - -} +public class HttpSessionConfig { }