I want to have a different server for my APIGEE load balancer Based on an if/else condition.
This is my current config that works a single server name (non dynamic):
<HTTPTargetConnection>
<Properties>
<Property name="response.streaming.enabled">true</Property>
</Properties>
<LoadBalancer>
<Server name="test1"/>
</LoadBalancer>
<Path>{pathSuffix}</Path>
</HTTPTargetConnection>
I'm trying to make the <Server name="test1"/>
dynamically change based on an if condition:
Something Like:
<HTTPTargetConnection>
<Properties>
<Property name="response.streaming.enabled">true</Property>
</Properties>
<LoadBalancer>
<Condition>reroute = "FALSE"</Condition>
<Server name="test1"/>
</LoadBalancer>
<LoadBalancer>
<Condition>reroute = "TRUE"</Condition>
<Server name="test2"/>
</LoadBalancer>
<Path>{pathSuffix}</Path>
</HTTPTargetConnection>
But it is not working. How can I have dynamically change the Server name here? or is there any other recommended way to do this?