Check readiness endpoint state in Apigee HealthMonitor

Viewed 73

I'm trying to setup Apigee proxy which would loadbalance between two target servers. For servers health check I created and exposed default spring boot health endpoint, but I fail to follow or find in Apigee official docs if it is possible to check payload or body returned by the health endpoints. https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers

Also tried to use Response code which works, but I want to check if health endpoint would return specifically status UP, as it technically can be with the status DOWN.

Health endpoint response body: {"status":"UP"}

Health monitor:

<HealthMonitor>
  <IsEnabled>true</IsEnabled>
  <IntervalInSec>5</IntervalInSec>
  <HTTPMonitor>
    <Request>
      <ConnectTimeoutInSec>10</ConnectTimeoutInSec>
      <SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
      <Port>8080</Port>
      <Verb>GET</Verb>
      <Path>/health/readiness</Path>
    </Request>
    <SuccessResponse>
      <ResponseCode>200</ResponseCode>
      <Payload>{"status":"UP"}</Payload>
    </SuccessResponse>
  </HTTPMonitor>
</HealthMonitor>
1 Answers
Related