骆驼盒组件的袜子代理失败
Socks proxy failure with camel-box component
我已经通过公司网络代理让骆驼盒组件运行良好,但速度非常慢。我尝试改用 socks 代理,这对我来说很适合 sftp 传输,但它失败了,几乎没有有用的错误消息。只是一个例外,我会挖掘出来并添加到问题中,但没有告诉我任何事情。任何人都可以发现我的代理配置有什么问题吗?这相当于我的 applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:camel="http://camel.apache.org/schema/spring" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd ">
<camelContext xmlns="http://camel.apache.org/schema/spring" id="boxtest">
<route id="getids">
<description>Fetch the names and Box unique ids for the root folder</description>
<from uri="jetty:http://0.0.0.0:/info"/>
<to uri="box://folders/getFolderItems?folderId=0&pagingRequest=#pr"/>
<to uri="bean:dump"/>
</route>
</camelContext>
<bean class="org.apache.camel.component.box.BoxComponent" id="box">
<property name="configuration" ref="cfg"/>
</bean>
<bean class="org.apache.camel.component.box.BoxConfiguration" id="cfg">
<property name="httpParams">
<map>
<entry key="http.route.socks-proxy" value="true"/>
<entry key="http.route.default-proxy">
<bean class="org.apache.http.HttpHost" id="proxy">
<constructor-arg index="0" value="my-socks-proxy"/>
<constructor-arg index="1" value="1085"/>
</bean>
</entry>
</map>
</property>
<property name="userName" value="j@b.com"/>
<property name="clientId" value="a83445cd422dbfc62ba9"/>
<property name="clientSecret" value="1701df702c00126783fc1701df702c00126783fc"/>
<property name="authSecureStorage" ref="auth"/>
</bean>
<bean id="auth" class="mypackage.Auth">
<property name="filename" value="box_credentials.properties"/>
</bean>
<bean id="pr" class="com.box.boxjavalibv2.requests.requestobjects.BoxPagingRequestObject"/>
</beans>
所以为了正式回答我的问题,配置中的错误是 socks 参数需要是布尔值,如下所示:
<entry key="http.route.socks-proxy">
<value type="java.lang.Boolean">true</value>
</entry>
但真正的问题是 Camel 2.14.1 中的 camel-box 只支持登录过程而不支持 restful 客户端。
我已经为此提交了一个补丁。
我已经通过公司网络代理让骆驼盒组件运行良好,但速度非常慢。我尝试改用 socks 代理,这对我来说很适合 sftp 传输,但它失败了,几乎没有有用的错误消息。只是一个例外,我会挖掘出来并添加到问题中,但没有告诉我任何事情。任何人都可以发现我的代理配置有什么问题吗?这相当于我的 applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:camel="http://camel.apache.org/schema/spring" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd ">
<camelContext xmlns="http://camel.apache.org/schema/spring" id="boxtest">
<route id="getids">
<description>Fetch the names and Box unique ids for the root folder</description>
<from uri="jetty:http://0.0.0.0:/info"/>
<to uri="box://folders/getFolderItems?folderId=0&pagingRequest=#pr"/>
<to uri="bean:dump"/>
</route>
</camelContext>
<bean class="org.apache.camel.component.box.BoxComponent" id="box">
<property name="configuration" ref="cfg"/>
</bean>
<bean class="org.apache.camel.component.box.BoxConfiguration" id="cfg">
<property name="httpParams">
<map>
<entry key="http.route.socks-proxy" value="true"/>
<entry key="http.route.default-proxy">
<bean class="org.apache.http.HttpHost" id="proxy">
<constructor-arg index="0" value="my-socks-proxy"/>
<constructor-arg index="1" value="1085"/>
</bean>
</entry>
</map>
</property>
<property name="userName" value="j@b.com"/>
<property name="clientId" value="a83445cd422dbfc62ba9"/>
<property name="clientSecret" value="1701df702c00126783fc1701df702c00126783fc"/>
<property name="authSecureStorage" ref="auth"/>
</bean>
<bean id="auth" class="mypackage.Auth">
<property name="filename" value="box_credentials.properties"/>
</bean>
<bean id="pr" class="com.box.boxjavalibv2.requests.requestobjects.BoxPagingRequestObject"/>
</beans>
所以为了正式回答我的问题,配置中的错误是 socks 参数需要是布尔值,如下所示:
<entry key="http.route.socks-proxy">
<value type="java.lang.Boolean">true</value>
</entry>
但真正的问题是 Camel 2.14.1 中的 camel-box 只支持登录过程而不支持 restful 客户端。
我已经为此提交了一个补丁。