Blame view

resources/spring/ApplicationContext-redis.xml 1.49 KB
ad5081d3   孙向锦   初始化项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  <?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"
  	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  	xmlns:p="http://www.springframework.org/schema/p"
  	xmlns:aop="http://www.springframework.org/schema/aop" 
  	xmlns:context="http://www.springframework.org/schema/context"
  	xmlns:tx="http://www.springframework.org/schema/tx"
  	xsi:schemaLocation="http://www.springframework.org/schema/beans 
  						http://www.springframework.org/schema/beans/spring-beans.xsd
  						http://www.springframework.org/schema/aop 
  						http://www.springframework.org/schema/aop/spring-aop.xsd
  						http://www.springframework.org/schema/context 
  						http://www.springframework.org/schema/context/spring-context.xsd
  						http://www.springframework.org/schema/tx 
  						http://www.springframework.org/schema/tx/spring-tx.xsd
  	">
  
  	<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">  
          <property name="connectionFactory"   ref="connectionFactory" />  
      </bean>   
      
      <bean id="connectionFactory" 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="poolConfig" class="redis.clients.jedis.JedisPoolConfig">  
          <property name="maxIdle" value="${redis.maxIdle}" />  
          <property name="testOnBorrow" value="${redis.testOnBorrow}" />  
      </bean>  
       
  </beans>