摘要: Jedis结合setNX方法实现分布式锁 public boolean lock(String key, int exprie) { try { exprie = exprie <= 0 ? 60 : exprie; String value = JsonUtil2.obj2String(creat 阅读全文
posted @ 2019-02-28 08:55 陈小兵 阅读(308) 评论(0) 推荐(0) 编辑
摘要: redisTemplate实现分布式锁 /** * 分布式锁-加锁 * @param key * @param value 当前时间+超时时间 System.currentTimeMillis()+timeout * @return */ public boolean lock(String key 阅读全文
posted @ 2019-02-28 08:55 陈小兵 阅读(171) 评论(0) 推荐(0) 编辑