I understand the Circuit Breaker pattern can be implemented with target health monitor in Apigee.
In my case, my target server host a bunch of APIs among them one of the API taking more time to respond and eventually timing it out. Since the time out taking more time, many threads are hanging in server. In this scenario health monitor passes since one among the 10 API is failing. heath monitor to realise the failure the entire server or the health check api has to go down which takes quiet some time. Is there a way to give high weightage to service response over health check response to trip the circuit for some time other than extending health monitor polling interval?
Below config helps to simulate the issue,
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<Flows/>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPTargetConnection>
<LoadBalancer>
<Server name="httpbin"/>
<MaxFailures>5</MaxFailures>
<ServerUnhealthyResponse>
<ResponseCode>502</ResponseCode>
<ResponseCode>503</ResponseCode>
</ServerUnhealthyResponse>
</LoadBalancer>
<Path>/</Path>
<HealthMonitor>
<IsEnabled>true</IsEnabled>
<IntervalInSec>5</IntervalInSec>
<HTTPMonitor>
<Request>
<ConnectTimeoutInSec>10</ConnectTimeoutInSec>
<SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
<Port>443</Port>
<Verb>GET</Verb>
<Path>/status/200</Path>
</Request>
<SuccessResponse>
<ResponseCode>200</ResponseCode>
</SuccessResponse>
</HTTPMonitor>
</HealthMonitor>
</HTTPTargetConnection>
</TargetEndpoint>
Call the proxy with /status/503 which will trip the circuit since the subsequent health check passes It put back the target in action.
Thanks,