redis 属性文件配置:

redis.host=xx.xx.xx.xx
redis.port=6379
#redis.pass=xxxxx
redis.maxIdle=10000
redis.maxTotal=100
redis.timeBetweenEvictionRunsMillis=30000
redis.minEvictableIdleTimeMillis=30000
redis.testOnBorrow=true
redis.encode=utf-8
redis.expire=604800000
redis.unlock=false
redis.timeout=0

	<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="jedis.shardInfo" class="redis.clients.jedis.JedisShardInfo">
<constructor-arg name="host" value="${redis.host}" />
<constructor-arg name="port" value="${redis.port}" />
<constructor-arg name="timeout" value="${redis.timeout}" />
</bean>
<bean id="shardedJedisPool" class="redis.clients.jedis.ShardedJedisPool">
<constructor-arg index="0" ref="jedisPoolConfig" />
<constructor-arg index="1">
<list>
<ref bean="jedis.shardInfo" />
</list>
</constructor-arg>
</bean>
<bean id="shardedJedis" factory-bean="shardedJedisPool"
factory-method="getResource" />

xi

shared jedis 在spring中的配置的更多相关文章

  1. Velocity初探小结--Velocity在spring中的配置和使用

    最近正在做的项目前端使用了Velocity进行View层的数据渲染,之前没有接触过,草草过了一遍,就上手开始写,现在又回头细致的看了一遍,做个笔记. velocity是一种基于java的模板引擎技术, ...

  2. C3P0连接池在hibernate和spring中的配置

    首先为什么要使用连接池及为什么要选择C3P0连接池,这里就不多说了,目前C3P0连接池还是比较方便.比较稳定的连接池,能与spring.hibernate等开源框架进行整合. 一.hibernate中 ...

  3. Spring中事务配置以及事务不起作用可能出现的问题

    前言:在Spring中可以通过对方法进行事务的配置,而不是像原来通过手动写代码的方式实现事务的操作,这在很大程度上减少了开发的难度,本文介绍Spring事务配置的两种方式:基于配置文件的方式和基于注解 ...

  4. spring中事务配置

    1 如果在方法.类.接口上使用注解的方式声明事务,需要在配置文件中进行配置,以便通知 Spring 容器对标注 @Transactional 注解的 bean 加工处理. 首先需要引入 tx 命名空间 ...

  5. Spring 中属性配置

    1 注册自定义属性编辑器,方法一.使用BeanFactory, 则用户需要手动调用 registerCustomEditor(Class requiredType, PropertyEditor pr ...

  6. spring中xml配置和autowired混用

    1.类的混用: 配置文件中的配置: <bean id="a" class="com.ab.cc.A" /> 类中的配置 @Autowired A a ...

  7. Druid 在spring中的配置

    Spring配置中dataSource配置 <bean id="dataSource" class="com.alibaba.druid.pool.DruidDat ...

  8. 关于spring中bean配置的几件小事

    一.IOC和DI 1.IOC(Inversion of Control) 其思想是反转资源获取的方向.传统的资源查找方式要求组件向容器发起请求查找资源,作为回应,容器适时的返回资源:而应用了IOC之后 ...

  9. c3p0在spring中的配置

    在大家的开发和学习其中应该经经常使用到数据库的连接和使用,只是连接 的方式就有非常多种方式了,例如说用最最简单的JDBC 也好,还实用比 较复杂一点的就是数据库连接池.当然还有使用DBCP的连接的,各 ...

随机推荐

  1. ubuntu12.04server下red5-1.0.0RC1的部署

    一.搭建环境 Linux版本:ubuntu12.04sever  64位 Java  版本:Java 1.7(jdk+jre) Red5 版本:red5-1.0.0-RC1 二.安装JDK 下载jdk ...

  2. BZOJ4590——[Shoi2015]自动刷题机

    1.题意:题意很简洁吧,就不概括了 2.分析:我思考了半天,我猜答案满足单调...没敢写,看了题解去问Claris为啥单调,Claris一句话" 因为n越大明显不可能做更多题 ", ...

  3. Sublime Text3中Autoprefixer失效解决方法

    进入CSS文件,默认配置在按下快捷键(Ctrl+Shift+P)后输入Autoprefix,你会发觉它什么事也没干,然后--这什么鬼?抓狂ing-- 原来是因为这玩意还要配置下,以下为配置方法: Pr ...

  4. ubuntu和centos安装RRDTool——cacti前置技能

    Installing Pre-Requisites Note that RRDTool 1.0.x versions included all dependancies, but 1.2.x vers ...

  5. Alcatraz,

    今天重装Alcatraz,运行github上的命令后,安装成功,可是配置界面没出来. 无奈重装, 先删除原本的插件 rm -rf ~/Library/Application\ Support/Deve ...

  6. No Entity Framework provider found for the ADO.NET provider with invariant

    在使用EF的时候,我把EF的EDMX放在单独的一个project中,UI中引用这个project的dll, 运行的时候就是提示No Entity Framework provider found fo ...

  7. Ubuntu 12.04安装Adobe Reader

    原本从Adobe 官方网站下载了 Adobe Reader, 是个rpm包,先用agt-get 装了rpm(sudo apt-get install rpm), 一安装(rpm -ivh AdobeR ...

  8. python DBUtils.PooledDB 中 maxcached 和 maxconnections

    PooledDB 有这么几个参数 mincached : the initial number of idle connections in the pool (the default of 0 me ...

  9. ABAP BAPI 销售订单生产交货单函数

    TYPES: BEGIN OF ty_so,          vbeln LIKE  vbap-vbeln,          posnr LIKE  vbap-posnr,        END  ...

  10. ABAP 客户报表

    *&---------------------------------------------------------------------* *& Report  ZSDR014 ...