HttpConnectionManagerParams不適用於HTTPS URL

我们使用Apache Camel的camel-http组件与HTTP端点集成,HttpConnectionManagerParams用于配置defaultconnectionsPerHost和maxTotalConnections。


<bean class="org.apache.commons.httpclient.params.HttpConnectionManagerParams" id="MyHttpConnectionManagerParams">

    <property name="defaultMaxConnectionsPerHost" value="20"/>

    <property name="maxTotalConnections" value="200"/>

</bean>

仅当终结点 URL 通过 HTTP 时,上述参数才会生效,相同的配置将变为 void,并且默认的 HttpConnectionManager 将在终结点通过 HTTPS 时生效。


是否有要为 HTTPS URL 额外配置的内容?


拉风的咖菲猫
浏览 130回答 1
1回答

ABOUTYOU

在下面添加豆子已经解决了我的工作。同意在Camel中没有名为HTTPS的组件,但是在较旧和较新版本的Apache Camel中,事情都在使用下面的配置。<bean class="org.apache.camel.component.http.HttpComponent" id="http">&nbsp; &nbsp;<property name="camelContext" ref="myCamelContext"/>&nbsp; &nbsp;<property name="httpConnectionManager" ref="MyHttpConnectionManager"/>&nbsp;</bean><bean class="org.apache.camel.component.http.HttpComponent" id="https">&nbsp; &nbsp;<property name="camelContext" ref="myCamelContext"/>&nbsp; &nbsp;<property name="httpConnectionManager" ref="MyHttpConnectionManager"/>&nbsp;</bean><bean class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager" id="MyHttpConnectionManager">&nbsp; &nbsp;<property name="params" ref="MyHttpConnectionManagerParams"/>&nbsp;</bean><bean class="org.apache.commons.httpclient.params.HttpConnectionManagerParams" id="MyHttpConnectionManagerParams">&nbsp; &nbsp;<property name="defaultMaxConnectionsPerHost" value="100"/>&nbsp; &nbsp;<property name="maxTotalConnections" value="500"/>&nbsp;</bean>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java