Dear Sanlam,
You can try ${response.tcp.remoteAddress}, but I am doubt that it can work as you expected.
I believe it only works if the route assertion is successful, in your case, if the cached DNS is wrong, the route assertion should fail and all the response properties should be empty(not set).
Regards,
Mark
Original Message:
Sent: 06-20-2019 02:30 AM
From: Ewan Sadie
Subject: requestHost IP as resolved by DNS
I am referring to the host defined in the Route.
The image snip is from a route deployed via the Portal.
In this case I need the IP of the host portion of the context variable ${apiLocation}.
I want to confirm if the gateways are resolving hosts correctly.
We also had issues in the past where IP's were changed but the DNS was cached in Java. This cache time was reduced but I need to be able to troubleshoot this.
------------------------------
API Tech Lead
Sanlam
Original Message:
Sent: 06-19-2019 10:16 PM
From: Zhijun He
Subject: requestHost IP as resolved by DNS
If you're talking about the IP of the reqeustor, you can use ${request.tcp.remoteip} context variable to get the IP of the requestor.
But usually there should be a load balancer before the gateway cluster, in that case the variable will always return the IP of the load balancer. Then your LB should be configured to send the x-forwarded-for header to contain the IP of original requestor, so that the gateway can check the value of XFF header to retrieve the IP of the original requestor.
Regards,
Mark
Original Message:
Sent: 06-19-2019 04:39 AM
From: Ewan Sadie
Subject: requestHost IP as resolved by DNS
Is there a way to retrieve the resolved DNS IP of the requestHost on the gateway?
------------------------------
API Tech Lead
Sanlam
------------------------------