add request response

This commit is contained in:
kimscott
2020-02-06 16:14:27 +09:00
parent 37eccd03e0
commit 2cacfca6b8
3 changed files with 20 additions and 1 deletions

View File

@@ -118,6 +118,22 @@ stages:
image: $(containerRegistry)/$(imageRepository):$(tag) image: $(containerRegistry)/$(imageRepository):$(tag)
ports: ports:
- containerPort: 8080 - containerPort: 8080
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 5
failureThreshold: 10
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 120
timeoutSeconds: 2
periodSeconds: 5
failureThreshold: 5
secretType: 'dockerRegistry' secretType: 'dockerRegistry'
containerRegistryType: 'Azure Container Registry' containerRegistryType: 'Azure Container Registry'
- task: Kubernetes@1 - task: Kubernetes@1

View File

@@ -86,7 +86,7 @@ steps:
initialDelaySeconds: 10 initialDelaySeconds: 10
timeoutSeconds: 2 timeoutSeconds: 2
periodSeconds: 5 periodSeconds: 5
failureThreshold: 5 failureThreshold: 10
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /actuator/health path: /actuator/health

View File

@@ -28,6 +28,9 @@ public class OrderController {
try { try {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(remoteURL + "/startDelivery", data, String.class); ResponseEntity<String> responseEntity = restTemplate.postForEntity(remoteURL + "/startDelivery", data, String.class);
String response = responseEntity.getBody(); String response = responseEntity.getBody();
logger.info(String.format(RESPONSE_STRING_FORMAT, response.trim()));
return ResponseEntity.ok(String.format(RESPONSE_STRING_FORMAT, response.trim())); return ResponseEntity.ok(String.format(RESPONSE_STRING_FORMAT, response.trim()));
} catch (Exception ex) { } catch (Exception ex) {
logger.warn("Exception trying to get the response from order service.", ex); logger.warn("Exception trying to get the response from order service.", ex);