Hi @dchiesa1 , Hi @kurtkanaskie
I am trying to configure a fall back server. When I receive a 500 response from Target-1 for 2 times, request should be forwarded to Target-2. Once health monitor is successfully requests should again be sent to Target-1.
Here is how I have configured Target endpoint:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<FaultRules/>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<Flows/>
<HTTPTargetConnection>
<LoadBalancer>
<Server name="Target1"/>
<Server name="Target2">
<IsFallback>true</IsFallback>
</Server>
<MaxFailures>2</MaxFailures>
<ServerUnhealthyResponse>
<ResponseCode>500</ResponseCode>
</ServerUnhealthyResponse>
</LoadBalancer>
<Path>/</Path>
<HealthMonitor>
<IsEnabled>true</IsEnabled>
<IntervalInSec>5</IntervalInSec>
<HTTPMonitor>
<Request>
<Port>80</Port>
<Verb>GET</Verb>
<Path>/</Path>
</Request>
<SuccessResponse>
<ResponseCode>200</ResponseCode>
</SuccessResponse>
</HTTPMonitor>
</HealthMonitor>
</HTTPTargetConnection>
</TargetEndpoint>
Response:
Status Code: 502
{
"fault": {
"faultstring": "Unexpected EOF at target",
"detail": {
"errorcode": "messaging.adaptors.http.flow.UnexpectedEOFAtTarget"
}
}
}
Can you please help?
Have you tried testing your target servers separately to ensure both are working?
At what point do you get the EOFAtTarget message? is this on the first request? After 2 failed requests?
Hi @dknezic ,
Target servers are working as expected separately.
I tried undeployed and re-deployed the proxy. For the first request to this proxy we are receiving 502.
In your example configuration, you had for the healthmonitor, port 80, GET /.. Is this port and path valid? What do you get for example with a curl request when using that port and path on your server?