diff --git a/src/main/java/io/lettuce/core/pubsub/StatefulRedisPubSubConnectionImpl.java b/src/main/java/io/lettuce/core/pubsub/StatefulRedisPubSubConnectionImpl.java index a68dab1e40..684e97f3fd 100644 --- a/src/main/java/io/lettuce/core/pubsub/StatefulRedisPubSubConnectionImpl.java +++ b/src/main/java/io/lettuce/core/pubsub/StatefulRedisPubSubConnectionImpl.java @@ -22,6 +22,7 @@ import java.util.List; import io.lettuce.core.RedisChannelWriter; +import io.lettuce.core.RedisCommandExecutionException; import io.lettuce.core.RedisFuture; import io.lettuce.core.StatefulRedisConnectionImpl; import io.lettuce.core.codec.RedisCodec; @@ -29,6 +30,7 @@ import io.lettuce.core.pubsub.api.async.RedisPubSubAsyncCommands; import io.lettuce.core.pubsub.api.reactive.RedisPubSubReactiveCommands; import io.lettuce.core.pubsub.api.sync.RedisPubSubCommands; +import io.netty.util.internal.logging.InternalLoggerFactory; /** * An thread-safe pub/sub connection to a Redis server. Multiple threads may share one {@link StatefulRedisPubSubConnectionImpl} @@ -40,8 +42,8 @@ * @param Value type. * @author Mark Paluch */ -public class StatefulRedisPubSubConnectionImpl extends StatefulRedisConnectionImpl implements - StatefulRedisPubSubConnection { +public class StatefulRedisPubSubConnectionImpl extends StatefulRedisConnectionImpl + implements StatefulRedisPubSubConnection { private final PubSubEndpoint endpoint; @@ -141,6 +143,13 @@ private T[] toArray(Collection c) { @Override public void activated() { super.activated(); - resubscribe(); + for (RedisFuture command : resubscribe()) { + command.exceptionally(throwable -> { + if (throwable instanceof RedisCommandExecutionException) { + InternalLoggerFactory.getInstance(getClass()).warn("Re-subscribe failed: " + command.getError()); + } + return null; + }); + } } }