Revert "convertAndSend returns the nr of targeted channels"

- DATAREDIS-118

- Change method return type back to void to fix backwards
compatibility issues

- Modify tests to assert specific clients receive or
don't receive messages vs comparing expected client counts
This commit is contained in:
Jennifer Hickey
2013-03-06 09:37:57 -08:00
parent 34725d0ca5
commit d46bee7e57
4 changed files with 56 additions and 48 deletions

View File

@@ -117,7 +117,7 @@ public interface RedisOperations<K, V> {
List<Object> exec();
// pubsub functionality on the template
Long convertAndSend(String destination, Object message);
void convertAndSend(String destination, Object message);
// operation types

View File

@@ -496,16 +496,17 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
}
public Long convertAndSend(String channel, Object message) {
public void convertAndSend(String channel, Object message) {
Assert.hasText(channel, "a non-empty channel is required");
final byte[] rawChannel = rawString(channel);
final byte[] rawMessage = rawValue(message);
return execute(new RedisCallback<Long>() {
execute(new RedisCallback<Object>() {
public Long doInRedis(RedisConnection connection) {
return connection.publish(rawChannel, rawMessage);
public Object doInRedis(RedisConnection connection) {
connection.publish(rawChannel, rawMessage);
return null;
}
}, true);
}