Query regarding TargetServer & HealthCheck

sidd-harth
Participant V

Hi guys, I'm using below config which has only one TargetServer foo (www.foo.com) & I am using HTTP Monitor to check the service status.

As per my understanding,

Let's say my backend(www.foo.com) is experiencing downtime and is not available. So as per my config Apigee will try and hit my backend 2 times and after 10secs (MaxFailures X IntervalInSec) the foo TargetServer will be marked down and Apigee will not attempt to establish a connection to the TargetServer.

Only when the HealthCheck(HTTP Monitor) starts passing, the TargetServer comes back into action and Apigee will try to hit my backend via TargetServer.

<HTTPTargetConnection>
        <Properties/>
        <LoadBalancer>
            <Server name="foo"/>
	    <MaxFailures>2</MaxFailures>
        </LoadBalancer>
        <Path>/test</Path>
        <HealthMonitor>
            <IsEnabled>true</IsEnabled>
            <IntervalInSec>5</IntervalInSec>
            <HTTPMonitor>
                <Request>
                    <ConnectTimeoutInSec>10</ConnectTimeoutInSec>
                    <SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
                    <Port>443</Port>
                    <Verb>GET</Verb>
                    <Path>/</Path>
                </Request>
                <SuccessResponse>
                    <ResponseCode>200</ResponseCode>
                </SuccessResponse>
            </HTTPMonitor>
        </HealthMonitor>
        <SSLInfo>
            <Enabled>true</Enabled>
        </SSLInfo>
    </HTTPTargetConnection>

Is my understanding correct or will Apigee keep on hitting my TargetServer even when it is down?

@Kurt Kanaskie

0 3 439
3 REPLIES 3

Yes, your understanding is correct.

"Apigee will try to hit my backend via TargetServer"

Yes, and by "Apigee will try to hit" , we infer "Apigee Edge will direct target requests to..."

The Heath check will "hit" the backend, of course.

This is all documented.

Let's say I have deployed two proxies in Apigee, Consumer & Producer. I'm calling the ProducerProxy from ConsumerProxy with above HTTPTargetConnection config. Everything works fine when both proxies are deployed.

When I manually un-deploy ProducerProxy, I am getting 503 Service Unavailable for ConsumerProxy requests as expected.

Even after re-deploying the ProducerProxy, I am getting 503 Service Unavailable for ConsumerProxy requests.

{"fault":{"faultstring":"The Service is temporarily unavailable","detail":{"errorcode":"messaging.adaptors.http.flow.NoActiveTargets"}}}

When I re-deploy the Producer proxy the HealthCheck in ConsumerProxy should pass & the TargetServer should be added automatically without any re-deployment right?

But it is not happening.

Only when I un-deploy & re-deploy ConsumerProxy, I get 200 OK.

Maybe @Shailendra Baxi can comment. Some of the related logic has been changed recently and I think he has some insight. Shailendra?