写代码的时候出现 :redis.clients.jedis.exceptions.JedisException: Could not return the resource to the pool
开始以为是大数据项目,分布式环境pool会不同步,后面发现是jedis对象的问题,在初始化的过程中使用了static关键字,导致
只有一个jedis对象
在代码使用的时候finally关闭 jedis.close()会出现这个错误:
最终解决:保证jedis对象不是静态的....不要使用关键字。
创建线程池参考:
https://www.cnblogs.com/caimuqing/p/6531161.html
package com.scut.emos.nziot_base.redis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
/**
* Created by CMQ on 2017/