From 4f31a4e51eb43738e3a8db5ca591b618cdc9eff0 Mon Sep 17 00:00:00 2001 From: 沈斌 <bluelazysb@hotmail.com> Date: Mon, 30 Oct 2017 15:14:41 +0800 Subject: [PATCH] 代码更新 --- src/main/resources/redis.xml | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/resources/redis.xml b/src/main/resources/redis.xml index ff4f41b..2db0476 100644 --- a/src/main/resources/redis.xml +++ b/src/main/resources/redis.xml @@ -21,11 +21,27 @@ <property name="testOnBorrow" value="${redis.testOnBorrow}" /> </bean> - <bean id="JedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" + <bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:host-name="${redis.host}" p:port="${redis.port}" p:password="${redis.pass}" p:pool-config-ref="poolConfig"/> + <bean id="stringRedisSerializer" class="org.springframework.data.redis.serializer.StringRedisSerializer"/> + <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"> - <property name="connectionFactory" ref="JedisConnectionFactory" /> + <property name="connectionFactory" ref="jedisConnectionFactory" /> + <property name="defaultSerializer" ref="stringRedisSerializer" /> + + <property name="keySerializer"> + <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" /> + </property> + <property name="valueSerializer"> + <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" /> + </property> + <property name="hashKeySerializer"> + <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" /> + </property> + <property name="hashValueSerializer"> + <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" /> + </property> </bean> </beans> \ No newline at end of file -- Gitblit v1.8.0