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

mark DefaultHealthCheckImpl ConditionalOnMissingBean

parent 37f99534
No related branches found
No related tags found
1 merge request!53customized readiness check to make sure cache layer is ready before serving traffic
...@@ -74,7 +74,11 @@ spec: ...@@ -74,7 +74,11 @@ spec:
- containerPort: 80 - containerPort: 80
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /api/partition/v1/swagger-ui.html path: /api/partition/v1/_ah/readiness_check
port: 80
livenessProbe:
httpGet:
path: /api/partition/v1/_ah/liveness_check
port: 80 port: 80
volumeMounts: volumeMounts:
- name: azure-keyvault - name: azure-keyvault
......
package org.opengroup.osdu.partition.service; package org.opengroup.osdu.partition.service;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService; import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@ConditionalOnMissingBean
public class DefaultHealthCheckImpl implements IHealthCheckService { public class DefaultHealthCheckImpl implements IHealthCheckService {
@Override @Override
......
...@@ -4,23 +4,19 @@ import lombok.RequiredArgsConstructor; ...@@ -4,23 +4,19 @@ import lombok.RequiredArgsConstructor;
import org.opengroup.osdu.partition.model.PartitionInfo; import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService; import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache; import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.opengroup.osdu.partition.service.DefaultHealthCheckImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class HealthCheckServiceImpl implements IHealthCheckService { public class HealthCheckServiceImpl extends DefaultHealthCheckImpl {
@Autowired @Autowired
@Qualifier("partitionServiceCache") @Qualifier("partitionServiceCache")
private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache; private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
@Override
public void performLivenessCheck() {
}
/** /**
* Cache layer must be ready before the pod can serve the traffic * Cache layer must be ready before the pod can serve the traffic
*/ */
......
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