Skip to content
Snippets Groups Projects
Commit ca828b0a authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

change health port to 8081, remove azure customized health implementation

parent fcdae6e9
No related branches found
No related tags found
1 merge request!53customized readiness check to make sure cache layer is ready before serving traffic
...@@ -49,7 +49,11 @@ spec: ...@@ -49,7 +49,11 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /api/partition/v1/actuator/health path: /api/partition/v1/actuator/health
port: 80 port: 8081
livenessProbe:
httpGet:
path: /api/partition/v1/actuator/health
port: 8081
volumeMounts: volumeMounts:
- name: azure-keyvault - name: azure-keyvault
mountPath: "/mnt/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} ...@@ -38,7 +38,7 @@ redis.database=${REDIS_DATABASE}
# health check # health check
management.health.azure-key-vault.enabled=false management.health.azure-key-vault.enabled=false
redis.custom.readiness.check.enabled=false management.server.port=8081
azure.cryptography.enabled=false azure.cryptography.enabled=false
azure.eventgrid.topic.enabled=false azure.eventgrid.topic.enabled=false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment