Failure Flags by Proxy and Java

Modified on Tue, 16 Dec at 2:38 PM

By default, many popular constructs in Java applications (such as Spring's RestTemplate) do not honor the HTTP_PROXY/HTTPS_PROXY environment variables. It is possible to use implementation specific proxy-aware constructs to pass traffic to the Failure Flags proxy- however, the JVM has builtin proxy mechanism that simplify leveraging Failure Flags and have the additional benefit of being framework/implementation agnostic.


The following JVM runtime options can be set to pass traffic in a way that obviates the need for code changes:

http.proxyHost #the host name of the proxy server
http.proxyPort # the proxy port, defaults to 80
http.nonProxyHosts # allows for specifying host patterns to bypass the proxy



The JVM's proxy uses HTTP CONNECT, which allows the failure flags sidecar route traffic and discovery dependencies (as it provides the traffic destination)


You can additional set HTTPS traffic via these similar configuration values, though path information will not be visible in the access logs.


https.proxyHost
https.proxyPort


When run directly, you can supply these runtime options with the '-D' flag, for example:

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article