实战 -- Redis2.4.2集成spring3.2.2

redis.host=...
redis.port=
redis.pass=
redis.timeout=
#最大能够保持idel状态的对象数
redis.maxIdle=
#最大分配的对象数
redis.maxTotal=
#多长时间检查一次连接池中空闲的连接
redis.timeBetweenEvictionRunsMillis=
#空闲连接多长时间后会被收回
redis.minEvictableIdleTimeMillis=
#当调用borrow Object方法时,是否进行有效性检查
redis.testOnBorrow=true
########reids编码格式
redis.encode=utf-
######缓存过期时间 秒 **** 七天
redis.expire=
####是否开启Redis服务应用
redis.unlock=false
<context:property-placeholder location="classpath:conf/redis.properties" />
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="${redis.maxTotal}" />
<property name="maxIdle" value="${redis.maxIdle}" />
<property name="timeBetweenEvictionRunsMillis" value="${redis.timeBetweenEvictionRunsMillis}" />
<property name="minEvictableIdleTimeMillis" value="${redis.minEvictableIdleTimeMillis}" />
<property name="testOnBorrow" value="${redis.testOnBorrow}" />
</bean> <bean id="jedisPool" class="redis.clients.jedis.JedisPool" destroy-method="destroy">
<constructor-arg ref="jedisPoolConfig" />
<constructor-arg value="${redis.host}" />
<constructor-arg type="int" value="${redis.port}" />
</bean> <bean id="jedisConnFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="hostName" value="${redis.host}" />
<property name="port" value="${redis.port}" />
<property name="password" value="${redis.pass}"/>
<property name="timeout" value="${redis.timeout}" />
<property name="poolConfig" ref="jedisPoolConfig" />
<property name="usePool" value="true" />
</bean> <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="jedisConnFactory"/>
</bean>
上一篇:使用JCONSOLE远程监控JVM


下一篇:openssl rsa/pkey