Load balancing across backend servers

Not applicable

Hi,

When I am trying to pass a url which is in the format

http://base_url/path_suffix; where target serve configurations are as follows

name: target1, host : mocktarget.apigee.net, port : 80, Enabled : true

I am getting the following error:

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

my code is as follows:

Please help me to know where i am wrong???

<TargetEndpoint name="default">
    <HTTPTargetConnection>
        <LoadBalancer>
            <Server name="sample1"/>
            <Path>/json</Path>
        </LoadBalancer>
    </HTTPTargetConnection>
</TargetEndpoint>
0 6 487
6 REPLIES 6

Not applicable

server name in the code is target1 not sample1

@Shivani Mishra,

One issue that I see in the target endpoint definition is that the Path element should be outside the LoadBalancer element as shown below:

<TargetEndpoint name="default">
    <HTTPTargetConnection>
        <LoadBalancer>
            <Server name="target1"/>
        </LoadBalancer>
        <Path>/json</Path>
    </HTTPTargetConnection>
</TargetEndpoint>

Ideally having the Path element inside the LoadBalancer element should not cause 503 error. But it will not append the path "/json" to the target server. Nevertheless, can you please try this and see if it works ?

If the problem persists, can you please try running the curl command directly as follows from your MP (assuming you are on Private Cloud) ?

curl -v http://mocktarget.apigee.net

If you are on public cloud, then please let me know the org and API name by sending an email to me. I can check on the issue and get back to you.

Regards,

Amar

@AMAR DEVEGOWDA I am still facing the same issue.

My enviornment is gecapgemini and API name is flowLoadBalance

http://gecapgemini-test.apigee.net/flowloadbalance

@Shivani Mishra,

Thanks for sharing the org and api name. I had a look into your API and noticed that the target server was still pointing to "sample1". I modified it to use "target1".

Now the calls are working fine. I get the following output:

{"firstName":"John","lastName":"Doe","city":"San Jose","state":"CA"}

Please verify.

@AMAR DEVEGOWDA thank u so much

In sample1 i gave the path as http://mocktarget.apigee.net/json and was so getting the error

Thanks again

@Shivani Mishra,

Glad to know that it's working fine. Thanks.