From 317cfd0f13d0a19bcc6436ac4eaed75a7dc9faee Mon Sep 17 00:00:00 2001 From: Aravindan Ramkumar <1028385+aravindanr@users.noreply.github.com> Date: Sat, 5 Dec 2020 00:05:29 -0800 Subject: [PATCH] using the same instance of JedisMock for both default and read client --- .../InMemoryRedisConfiguration.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/configuration/InMemoryRedisConfiguration.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/configuration/InMemoryRedisConfiguration.java index f56fc9f93f..46da34135e 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/configuration/InMemoryRedisConfiguration.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/configuration/InMemoryRedisConfiguration.java @@ -12,29 +12,29 @@ */ package com.netflix.conductor.redis.configuration; -import com.netflix.conductor.redis.configuration.JedisCommandsConfigurer; import com.netflix.conductor.redis.config.utils.RedisProperties; import com.netflix.conductor.redis.jedis.JedisMock; -import com.netflix.conductor.redis.jedis.LocalHostSupplierProvider; +import com.netflix.conductor.redis.jedis.LocalhostHostSupplier; import com.netflix.dyno.connectionpool.HostSupplier; -import com.netflix.dyno.connectionpool.TokenMapSupplier; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import redis.clients.jedis.commands.JedisCommands; + +import static com.netflix.conductor.redis.configuration.RedisCommonConfiguration.DEFAULT_CLIENT_INJECTION_NAME; +import static com.netflix.conductor.redis.configuration.RedisCommonConfiguration.READ_CLIENT_INJECTION_NAME; @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = "db", havingValue = "memory", matchIfMissing = true) -public class InMemoryRedisConfiguration extends JedisCommandsConfigurer { +public class InMemoryRedisConfiguration { @Bean public HostSupplier hostSupplier(RedisProperties properties) { - return new LocalHostSupplierProvider(properties).get(); + return new LocalhostHostSupplier(properties); } - @Override - protected JedisCommands createJedisCommands(RedisProperties properties, HostSupplier hostSupplier, TokenMapSupplier tokenMapSupplier) { + @Bean(name = {DEFAULT_CLIENT_INJECTION_NAME, READ_CLIENT_INJECTION_NAME}) + public JedisMock jedisMock() { return new JedisMock(); } }