Commit ca828b0a authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

change health port to 8081, remove azure customized health implementation

parent fcdae6e9
......@@ -49,7 +49,11 @@ spec:
readinessProbe:
httpGet:
path: /api/partition/v1/actuator/health
port: 80
port: 8081
livenessProbe:
httpGet:
path: /api/partition/v1/actuator/health
port: 8081
volumeMounts:
- name: azure-keyvault
mountPath: "/mnt/azure-keyvault"
......
package org.opengroup.osdu.partition.provider.azure.service;
import lombok.RequiredArgsConstructor;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
@Service
@Primary
@RequiredArgsConstructor
class CacheServiceHealthIndicatorImpl implements HealthIndicator {
@Autowired
@Qualifier("partitionServiceCache")
private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
@Value("${redis.custom.readiness.check.enabled}")
private boolean redisCustomReadinessCheck;
@Override
public Health health() {
if (redisCustomReadinessCheck) {
try {
partitionServiceCache.get("dummy-key");
} catch (Exception ex) {
return Health.down().withDetail("Cache service", ex).build();
}
}
return Health.up().build();
}
}
......@@ -38,7 +38,7 @@ redis.database=${REDIS_DATABASE}
# health check
management.health.azure-key-vault.enabled=false
redis.custom.readiness.check.enabled=false
management.server.port=8081
azure.cryptography.enabled=false
azure.eventgrid.topic.enabled=false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment