How do i test routing the requests to multiple backends

Hi,

I have the below configurations in my proxy:

<LoadBalancer> <Algorithm>RoundRobin</Algorithm><Server name="target1"/> <Server name="target2"/> <MaxFailures>0</MaxFailures> <!--<RetryEnabled>true</RetryEnabled>--> </LoadBalancer>

if i test the targets individually, i see target1 is giving success response and target2 is erroring out with "Service Unavailable".

But with the configuration set as above i am always getting success response. As i specified "RoundRobin" algorithm and retryenabled is commented, my expectation is to get failure response for every other request.

How do i test this behaviour?

How can we monitor whether the request is going to which target from the trace? as i dont have access to infra logs.

0 4 171
4 REPLIES 4

HI @ravi kumar karlapudi, try making 10 calls and check the responses.

Which Apigee product are you using Free Cloud/Private Instance?

In trace, we can see to which server the call is going, check below image,

7344-targetserver2.jpg

Thanks @Siddharth Barahalikar,

Now i am able to see the loadbalancing targetserver on the trace, but i see all the requests are going to the target1 and getting success responses. As per my configurations the requests should be sent to target2 as well and report the error response from target2.

Any inputs here?

I am using the same config & it is working fine for me. Try to redploy the proxy.

Also remove MaxFailure, as it is anway 0 in your config.

7345-targetserver22.jpg

Hi @Siddharth Barahalikar,

i have uncommented the <RetryEnabled> and made it false, then i see it is working as expected.

By default <RetryEnabled> is setting to true, and that is the reason all the requests are routing to target which is available.

Thanks for your help.