Polishing.
Allow Jedis to exist pub/sub loop gracefully. Await unsubscribe. Reduce retry backoff to allow from broken connection recovery. Do not use pooling to avoid using broken connections. See #2256
This commit is contained in:
@@ -56,7 +56,7 @@ public class JedisConnectionFactoryExtension implements ParameterResolver {
|
||||
.create(JedisConnectionFactoryExtension.class);
|
||||
|
||||
private static final JedisClientConfiguration CLIENT_CONFIGURATION = JedisClientConfiguration.builder()
|
||||
.clientName("jedis-client").usePooling().build();
|
||||
.clientName("jedis-client").build();
|
||||
|
||||
private static final NewableLazy<JedisConnectionFactory> STANDALONE = NewableLazy.of(() -> {
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ class RedisMessageListenerContainerIntegrationTests {
|
||||
void setUp() {
|
||||
|
||||
container = new RedisMessageListenerContainer();
|
||||
container.setRecoveryInterval(100);
|
||||
container.setConnectionFactory(connectionFactory);
|
||||
container.setBeanName("container");
|
||||
container.afterPropertiesSet();
|
||||
|
||||
@@ -81,7 +81,7 @@ class RedisMessageListenerContainerUnitTests {
|
||||
doAnswer(it -> {
|
||||
|
||||
Runnable r = it.getArgument(0);
|
||||
new Thread(r).start();
|
||||
r.run();
|
||||
return null;
|
||||
}).when(executorMock).execute(any());
|
||||
|
||||
@@ -103,7 +103,7 @@ class RedisMessageListenerContainerUnitTests {
|
||||
container.stop();
|
||||
|
||||
assertThat(container.isRunning()).isFalse();
|
||||
verify(subscriptionMock).close();
|
||||
verify(connectionMock).close();
|
||||
}
|
||||
|
||||
@Test // GH-964
|
||||
|
||||
Reference in New Issue
Block a user