Apigee: Set use.proxy dynamically instead of hard-coded

220 views Asked by At

We need to clarify if the use.proxy is true or false and this value should come dynamically via the properties file. Following two scenarios can happen:

  • If we send a request or a service callout to the real backend, we need use.proxy=true.
  • If we send a request or a service callout to the simulated backend (for continuous integration), we need use.proxy=false.

Unfortunately the simulation is an IP, which is not accessible via a proxy.

What we tried out:

<Property name="use.proxy">{_PROXY_CHOICE}</Property>

And in the properties-file the argument:

context.setVariable('_PROXY_CHOICE', '${proxy.choice}');

But nothing happened. Anyone any clues how to solve this issue?

1

There are 1 answers

0
Srikanth On

I would have proxy to real backend configured in the properties file and have use.proxy set to true - so by default it keeps using real backend. And use.proxy to false in case of simulation in the proxy - so just play around with use.proxy based on the request - as i understand you can change this per request in proxy.