DATAREDIS-1231 - Use Jedis command routing if multiple BRPOP keys map to a single slot.
Original pull request: #568.
This commit is contained in:
@@ -303,6 +303,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<List<byte[]>>) (client, key) -> client.brpop(timeout, key),
|
||||
|
||||
Reference in New Issue
Block a user