From 74cf06f7af65c699187f9e268db58023db2e2a62 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Fri, 28 Apr 2023 15:02:00 +0100 Subject: Align the hazelcast cluster names - We need to align the hazelcast cluster names as members of the same cluster can join each other. We will still have exclusivity as the instance names and configs are different for each distributed object. - Exposing env variable to override the cluster name depending on the env it is run on. - Modified test cases to validate the cluster names as well Issue-ID: CPS-1637 Change-Id: Ib0f8c80dc9b2268f976b0c2d3ccd6d64792d4781 Signed-off-by: mpriyank --- .../config/embeddedcache/SynchronizationCacheConfig.java | 13 ++++--------- .../event/avc/ForwardedSubscriptionEventCacheConfig.java | 3 +-- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'cps-ncmp-service/src/main') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java index ff7afc9eb7..62a380ca5c 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java @@ -51,9 +51,7 @@ public class SynchronizationCacheConfig extends HazelcastCacheConfig { */ @Bean public BlockingQueue moduleSyncWorkQueue() { - return createHazelcastInstance("moduleSyncWorkQueue", commonQueueConfig, - "synchronization-caches") - .getQueue("moduleSyncWorkQueue"); + return createHazelcastInstance("moduleSyncWorkQueue", commonQueueConfig).getQueue("moduleSyncWorkQueue"); } /** @@ -63,9 +61,8 @@ public class SynchronizationCacheConfig extends HazelcastCacheConfig { */ @Bean public IMap moduleSyncStartedOnCmHandles() { - return createHazelcastInstance("moduleSyncStartedOnCmHandles", moduleSyncStartedConfig, - "synchronization-caches") - .getMap("moduleSyncStartedOnCmHandles"); + return createHazelcastInstance("moduleSyncStartedOnCmHandles", moduleSyncStartedConfig).getMap( + "moduleSyncStartedOnCmHandles"); } /** @@ -75,8 +72,6 @@ public class SynchronizationCacheConfig extends HazelcastCacheConfig { */ @Bean public IMap dataSyncSemaphores() { - return createHazelcastInstance("dataSyncSemaphores", dataSyncSemaphoresConfig, - "synchronization-caches") - .getMap("dataSyncSemaphores"); + return createHazelcastInstance("dataSyncSemaphores", dataSyncSemaphoresConfig).getMap("dataSyncSemaphores"); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/ForwardedSubscriptionEventCacheConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/ForwardedSubscriptionEventCacheConfig.java index d2c3dc2599..443ebc627a 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/ForwardedSubscriptionEventCacheConfig.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/ForwardedSubscriptionEventCacheConfig.java @@ -45,7 +45,6 @@ public class ForwardedSubscriptionEventCacheConfig extends HazelcastCacheConfig @Bean public IMap> forwardedSubscriptionEventCache() { return createHazelcastInstance("hazelCastInstanceSubscriptionEvents", - forwardedSubscriptionEventCacheMapConfig, "cps-ncmp-service-caches") - .getMap("forwardedSubscriptionEventCache"); + forwardedSubscriptionEventCacheMapConfig).getMap("forwardedSubscriptionEventCache"); } } -- cgit 1.2.3-korg