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


    redis.host=192.168.1.237
    redis.port=6379
    redis.pass=
    redis.timeout=100000
    #最大能够保持idel状态的对象数 
    redis.maxIdle=300
    #最大分配的对象数    
    redis.maxTotal=600
    #多长时间检查一次连接池中空闲的连接 
    redis.timeBetweenEvictionRunsMillis=30000  
    #空闲连接多长时间后会被收回 
    redis.minEvictableIdleTimeMillis=30000 
    #当调用borrow Object方法时,是否进行有效性检查   
    redis.testOnBorrow=true
    ########reids编码格式 
    redis.encode=utf-8
    ######缓存过期时间 秒  1000*60*60*24*7 七天 
    redis.expire=604800000
    ####是否开启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>
  • 相关阅读:
    三种创建线程的方式详解。
    HashMap详解 基于jdk1.7
    Urlrewritefilte
    windows下搭建Nexus3私服和基于IDEA15的Maven学习笔记
    SEVERE: Error listenerStart
    我理解的设计模式-------抽象工厂模式
    activemq启动不起来,报错Address already in use: JVM_Bind
    Hibernate一对一双向关联(外键)
    http请求错误码
    跨域(一)
  • 原文地址:https://www.cnblogs.com/damowang/p/4451652.html
Copyright © 2020-2023  润新知