diff --git a/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/cache/SchemaCacheImpl.java b/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/cache/SchemaCacheImpl.java index c8c13a334fb10814a7fbf063e778095db0d3aac2..ae300d950d7bca03ed4a243e04b96f1eed46591b 100644 --- a/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/cache/SchemaCacheImpl.java +++ b/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/cache/SchemaCacheImpl.java @@ -14,6 +14,9 @@ package org.opengroup.osdu.indexer.aws.cache; +import com.fasterxml.jackson.core.JsonProcessingException; +import org.opengroup.osdu.core.aws.cache.AwsElasticCache; +import org.opengroup.osdu.core.aws.ssm.K8sParameterNotFoundException; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.cache.RedisCache; import org.opengroup.osdu.indexer.provider.interfaces.ISchemaCache; @@ -25,12 +28,8 @@ public class SchemaCacheImpl implements ISchemaCache<String, String>, AutoClosea private ICache<String, String> cache; private Boolean local = false; - public SchemaCacheImpl(@Value("${aws.elasticache.cluster.endpoint}") final String REDIS_SEARCH_HOST, - @Value("${aws.elasticache.cluster.port}") final String REDIS_SEARCH_PORT, - @Value("${aws.elasticache.cluster.key}") final String REDIS_SEARCH_KEY, - @Value("${aws.elasticache.cluster.schema.expiration}") final String SCHEMA_CACHE_EXPIRATION) { - cache = new RedisCache<>(REDIS_SEARCH_HOST, Integer.parseInt(REDIS_SEARCH_PORT), REDIS_SEARCH_KEY, - Integer.parseInt(SCHEMA_CACHE_EXPIRATION) * 60, String.class, String.class); + public SchemaCacheImpl(@Value("${aws.elasticache.cluster.schema.expiration}") final String SCHEMA_CACHE_EXPIRATION) throws K8sParameterNotFoundException, JsonProcessingException { + cache = AwsElasticCache.RedisCache(Integer.parseInt(SCHEMA_CACHE_EXPIRATION) * 60, String.class, String.class); if (cache.getClass() == RedisCache.class){ local = false; }else{ diff --git a/provider/indexer-aws/src/main/resources/application.properties b/provider/indexer-aws/src/main/resources/application.properties index 27054c982b98d7ea757b66fefc30694e21b21705..cf570905d6585805d6f5ed81f6eda671da194db7 100644 --- a/provider/indexer-aws/src/main/resources/application.properties +++ b/provider/indexer-aws/src/main/resources/application.properties @@ -32,9 +32,6 @@ STORAGE_QUERY_RECORD_FOR_CONVERSION_HOST=${STORAGE_BASE_URL}/api/storage/v2/quer STORAGE_RECORDS_BATCH_SIZE=20 INDEXER_QUEUE_HOST="" ## AWS ElastiCache configuration -aws.elasticache.cluster.endpoint=${CACHE_CLUSTER_ENDPOINT} -aws.elasticache.cluster.port=${CACHE_CLUSTER_PORT} -aws.elasticache.cluster.key=${CACHE_CLUSTER_KEY} ## Cache Settings aws.elasticache.cluster.index.expiration=60