[英]Why need extra step by using http.proxyHost for apache camel http component
By using http.proxyHost for apache camel http component.通过使用 http.proxyHost 为 apache 骆驼 http 组件。 It need two steps below, otherwise http.proxy will not work for camel http component.它需要以下两个步骤,否则 http.proxy 将无法用于 camel http 组件。
put -Dhttp.proxyHost at java command line将 -Dhttp.proxyHost 放在 java 命令行
at camel http query paramter, setting useSystemProperties to true在骆驼 http 查询参数中,将 useSystemProperties 设置为 true
but for javax.net.ssl.trustStore, step 2 is not need.但对于 javax.net.ssl.trustStore,不需要第 2 步。
Since both of them(trustStore or httpProxy) are system properties could be used via java command line.由于它们(trustStore 或 httpProxy)都是系统属性,可以通过 java 命令行使用。 Why http.proxyHost need step2, but javax.net.ssl.trustStore does not?为什么http.proxyHost需要step2,而javax.net.ssl.trustStore不需要? Could anyone have some idea?任何人都可以有一些想法吗?
Thanks in advancace!提前致谢!
Apache Camel HTTP component provide a per URI / Endpoint way of configuring an HTTP proxy: Apache Camel HTTP组件提供了一种配置 HTTP 代理的每个 URI/端点方式:
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:这允许org.apache.http.client.HttpClient
在解析和创建 HTTP 代理时考虑配置优先级:
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.如果用户希望通过设置useSystemProperties
组件选项,则可以完全跳过所有配置解析步骤以回退使用系统属性中的所有 HTTP(S) 相关属性(在底层org.apache.http.client.HttpClient
)。
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.总而言之,您可以将 HTTP 相关属性解析过程视为为用户提供一组灵活的配置选项以适应所有用例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.