By using http.proxyHost for apache camel http component. It need two steps below, otherwise http.proxy will not work for camel http component.
put -Dhttp.proxyHost at java command line
at camel http query paramter, setting useSystemProperties to true
but for javax.net.ssl.trustStore, step 2 is not need.
Since both of them(trustStore or httpProxy) are system properties could be used via java command line. Why http.proxyHost need step2, but javax.net.ssl.trustStore does not? Could anyone have some idea?
Thanks in advancace!
Apache Camel HTTP component provide a per URI / Endpoint way of configuring an HTTP proxy:
from("direct:start")
.to("http://somehost?proxyAuthHost=www.someproxy.com&proxyAuthPort=80");
Adds to that a way to override proxy configuration using a context global options:
context.getGlobalOptions().put("http.proxyHost", "someproxy");
context.getGlobalOptions().put("http.proxyPort", "someport");
This allows the org.apache.http.client.HttpClient
to be consider configuration precedence when resolving and creating the HTTP proxy:
All of the configuration resolution steps can be skipped altogether to fallback on using all HTTP(S) related properties (within the underlying org.apache.http.client.HttpClient
) from the system properties if the user wishes so by setting the useSystemProperties
component option.
As a summary, you can think of the HTTP related properties resolution process as providing a set of flexible configuration options to the user to fit in all use cases.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.