天天看點

[redis]redisson-Unable to send command

1.背景

由于需要使用 分布式鎖,引入了Redisson.  Redisson封裝了很多進階用法. 我們用到了分布式鎖 .但是使用的過程中,遇到一些問題.記錄一下吧

2.使用方法

和jedis使用上的差別,jedis使用起來比較簡潔.你會redis的指令,基本上也就知道咋用了.但是redisson是你得用他的一套用法.具體可以看下https://blog.csdn.net/learner198461/article/details/87192834

1.例如hget.需要寫成

redissonClient.getMap("name").get("ll");      

但是如果你去debug的話,redissonClient.getMap("name").發現會看到這個name的所有值. 就是相當于hgetall 了.然後我一頓找.看代碼還沒到查詢redis呢.

然後再github中找到了答案.https://github.com/redisson/redisson/issues/2200

是因為你的調試器,去做的....額..

[redis]redisson-Unable to send command

2.Unable to send command!

突然報錯...

趕緊google.

https://github.com/redisson/redisson/issues/1811

bug. 更新就行了.大緻原因是. 沒有重連

ConnectionWatchdog.java

[redis]redisson-Unable to send command

先記錄下吧.不知道還有沒有坑.

繼續閱讀