Open
Description
If we use a forwarding RedisConnectionFactory
, which does not extends the LettuceConnectionFactory
, and delegate the get connection to LettuceConnectionFactory
, then the RedisMessageListenerContainer
does not work anymore. It works in 2.6.13.
public class RedisConnectionProxyFactory
implements RedisConnectionFactory, ReactiveRedisConnectionFactory {
private final LettuceConnectionFactory innerFactory;
public RedisConnectionProxyFactory(LettuceConnectionFactory factory) {
this.innerFactory = factory;
}
@Override
public RedisConnection getConnection() {
return innerFactory.getConnection();
}
}
It seems caused by this method, the isAsync() is false, so the subscribe is close immediately, and the Container stops working.
private Subscriber createSubscriber(RedisConnectionFactory connectionFactory, Executor executor) {
return ConnectionUtils.isAsync(connectionFactory) ? new Subscriber(connectionFactory)
: new BlockingSubscriber(connectionFactory, executor);
}