From 050b2517d9d1e62285707e5aef9e3d0a7ae003e3 Mon Sep 17 00:00:00 2001
From: ZMai <zmai@slb.com>
Date: Tue, 4 Jul 2023 20:10:20 -0500
Subject: [PATCH] Set the Redis Cache as primary component

---
 .../osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java    | 2 ++
 .../osdu/indexer/azure/cache/RelatedObjectRedisCache.java       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java
index ed0097159..0f2634719 100644
--- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java
+++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java
@@ -20,11 +20,13 @@ import org.opengroup.osdu.indexer.cache.IRecordChangeInfoCache;
 import org.opengroup.osdu.indexer.model.RecordChangeInfo;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Named;
 
 @Component
+@Primary
 @ConditionalOnProperty(value = "runtime.env.local", havingValue = "false", matchIfMissing = true)
 public class RecordChangeInfoRedisCache extends RedisCache<String, RecordChangeInfo> implements IRecordChangeInfoCache {
     public RecordChangeInfoRedisCache(final @Named("REDIS_HOST") String host,
diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java
index c37f5c59a..9e6c0b58f 100644
--- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java
+++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java
@@ -20,11 +20,13 @@ import org.opengroup.osdu.core.common.model.storage.RecordData;
 import org.opengroup.osdu.indexer.cache.IRelatedObjectCache;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Named;
 
 @Component
+@Primary
 @ConditionalOnProperty(value = "runtime.env.local", havingValue = "false", matchIfMissing = true)
 public class RelatedObjectRedisCache  extends RedisCache<String, RecordData> implements IRelatedObjectCache {
     public RelatedObjectRedisCache(final @Named("REDIS_HOST") String host,
-- 
GitLab