From 41fc2403b20066dbbb97c0cc2c7c715f5c46abc9 Mon Sep 17 00:00:00 2001 From: maggu Date: Tue, 23 Jul 2024 13:39:57 -0400 Subject: [PATCH] Feature # 220 - Make redis key space domain customizable Makes redis key space domain customizable, there by allowing multi-tenant software to namespace | isolate their data in the same redis db. This primarily applies to the hash bucket keys. In com.netflix.conductor.redis.dao.BaseDynoDAO instead of the domain being a member variable, access from the property instance on demand. A derived bean instance of ConductorProperties (already a member of BaseDynoDAO) will be able to access the customized domain seamlessly. --- .../main/java/com/netflix/conductor/redis/dao/BaseDynoDAO.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/BaseDynoDAO.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/BaseDynoDAO.java index 95a363f87..31830fba1 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/BaseDynoDAO.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/BaseDynoDAO.java @@ -28,7 +28,6 @@ public class BaseDynoDAO { private static final String NAMESPACE_SEP = "."; private static final String DAO_NAME = "redis"; - private final String domain; private final RedisProperties properties; private final ConductorProperties conductorProperties; protected JedisProxy jedisProxy; @@ -43,7 +42,6 @@ protected BaseDynoDAO( this.objectMapper = objectMapper; this.conductorProperties = conductorProperties; this.properties = properties; - this.domain = properties.getKeyspaceDomain(); } String nsKey(String... nsValues) { @@ -56,6 +54,7 @@ String nsKey(String... nsValues) { if (StringUtils.isNotBlank(stack)) { namespacedKey.append(stack).append(NAMESPACE_SEP); } + String domain = properties.getKeyspaceDomain(); if (StringUtils.isNotBlank(domain)) { namespacedKey.append(domain).append(NAMESPACE_SEP); }