Http Health Monitor Check Not Working with dynamic variables

Not applicable

I have HTTP Target Tab as:

<HTTPTargetConnection>
        <Properties/>
        <LoadBalancer>
            <Server name="PCFHealthTarget"/>
            <MaxFailures>5</MaxFailures>
        </LoadBalancer>
        <Path>/v1</Path>
        <HealthMonitor>
            <IsEnabled>true</IsEnabled>
            <IntervalInSec>5</IntervalInSec>
            <HTTPMonitor>
                <Request>
                    <ConnectTimeoutInSec>10</ConnectTimeoutInSec>
                    <SocketReadTimeoutInSec>400</SocketReadTimeoutInSec>
                    <Path>/v1/customers/search?msisdn=3862811031</Path>
                    <Header name="Authorization">Bearer l3YVt6uBYU74QK8mGF1siGdrqu0O</Header>

                </Request>
                <SuccessResponse>
                    <ResponseCode>200</ResponseCode>
                </SuccessResponse>
            </HTTPMonitor>
        </HealthMonitor>
    </HTTPTargetConnection>

Health Monitor fine but as soon as I add the verb {{request.verb}} as below doesn't work.

Also, can we have multiple response code values in <ResponseCode> tag and how to achieve it.

We need to do a health check on backend servers.Is below right way to approach

<HTTPMonitor>
                <Request>
                    <ConnectTimeoutInSec>10</ConnectTimeoutInSec>
                    <SocketReadTimeoutInSec>400</SocketReadTimeoutInSec>
                    <Path>/v1/customers/search?msisdn=3862811031</Path>
                    <Header name="Authorization">Bearer l3YVt6uBYU74QK8mGF1siGdrqu0O</Header>
<Verb>{request.verb}</Verb>
                </Request>
                <SuccessResponse>
                    <ResponseCode>200</ResponseCode>
                </SuccessResponse>
            </HTTPMonitor>
0 4 427
4 REPLIES 4

Hi @mohit.baveja ,

It doesn't make sense to try and get the request verb, because there is no request flow.

Edge is generating the request to check the Path every <IntervalInSec>.

What I did discover while testing different verbs, is that you need to have at least an empty payload for POST to work, otherwise Edge uses GET.

<Verb>POST</Verb>
<Payload><Payload>

Also, if you use GET, you must not have a Payload, otherwise Edge will force it to use POST.

Thanks for using the community and don't forget to hit Accept if your satisfied!

Hi Kurt,

My point is what if I want the path to dynamic Variables, because my backend path is not the same as front-end path. Can health Monitor works with dynamic variables, even payload will be diiferent for different scenarios

No, Edge is generating the health check request and sending it to the targets, independent of an API proxy traffic. So there is no place to get the variables from.

Not even from the environment? We need to pass a header value required by our backend stored in our Apigee environment. Is there no way to retrieve those either?