jedis包括2.4.1,2.5.1等高版本的JedisPoolConfig沒有maxActive屬性,不能按照網上那些方式去配置redis了,網上大部分搜索出來的redis配置都是基於舊版本的jedis,在jedis新版本,JedisPoolConfig沒有maxActive和maxWait屬性,已經被替換成其餘的命名。redis
經過查找可知高版本的jedis使用了org.apache.commons.pool2.impl.GenericObjectPoolConfig。apache
因此高版本jedis配置JedisPoolConfig的maxActive,maxWait應該爲:code
<
bean
id
=
"jedisPoolConfig"
class
=
"redis.clients.jedis.JedisPoolConfig"
>
it
<
property
name
=
"maxIdle"
value
=
"${redis.pool.maxIdle}"
/>
class
<
property
name
=
"maxTotal"
value
=
"${redis.pool.maxActive}"
/>
test
<
property
name
=
"maxWaitMillis"
value
=
"${redis.pool.maxWait}"
/>
cli
<
property
name
=
"testOnBorrow"
value
=
"${redis.pool.testOnBorrow}"
/>
配置
<
property
name
=
"testOnReturn"
value
=
"${redis.pool.testOnReturn}"
/>
搜索
</
bean
>
im