diff --git a/src/main/java/com/lambdaworks/redis/cluster/ClusterDistributionChannelWriter.java b/src/main/java/com/lambdaworks/redis/cluster/ClusterDistributionChannelWriter.java index deba735e82..8a9764919e 100644 --- a/src/main/java/com/lambdaworks/redis/cluster/ClusterDistributionChannelWriter.java +++ b/src/main/java/com/lambdaworks/redis/cluster/ClusterDistributionChannelWriter.java @@ -91,6 +91,10 @@ public RedisCommand write(RedisCommand command) { channelWriter = writer.defaultWriter; } + if(command.getOutput() != null){ + commandToSend.getOutput().setError((String) null); + } + if (channelWriter != null && channelWriter != this && channelWriter != defaultWriter) { return channelWriter.write(commandToSend); } diff --git a/src/test/java/com/lambdaworks/redis/cluster/AdvancedClusterClientTest.java b/src/test/java/com/lambdaworks/redis/cluster/AdvancedClusterClientTest.java index 2170892958..c19ed7e043 100644 --- a/src/test/java/com/lambdaworks/redis/cluster/AdvancedClusterClientTest.java +++ b/src/test/java/com/lambdaworks/redis/cluster/AdvancedClusterClientTest.java @@ -207,6 +207,19 @@ public void pipelining() throws Exception { verificationConnection.close(); } + + @Test + public void transactions() throws Exception { + + connection.multi(); + connection.set(key, value); + connection.discard(); + + connection.multi(); + connection.set(key, value); + connection.exec(); + } + protected String value(int i) { return value + "-" + i; }