diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java index 3bfe498ff..07af74eda 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java @@ -287,6 +287,14 @@ class JedisClusterListCommands implements RedisListCommands { Assert.notNull(keys, "Key must not be null!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); + if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { + try { + return connection.getCluster().brpop(timeout,keys); + } catch (Exception ex) { + throw convertJedisAccessException(ex); + } + } + return connection.getClusterCommandExecutor() .executeMultiKeyCommand( (JedisMultiKeyClusterCommandCallback>) (client, key) -> client.brpop(timeout, key),