无法通过 Apache Camel 访问外部 HTTP 服务
Not able to hit external HTTP service via Apache Camel
我的骆驼路线类似于:
<camel:routeContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="restlet:/v1/authentication/initiate?restletMethod=post&restletBinding=#queryStringToHeadersRestletBinding"/>
<to uri="http://xx.xx.xx.xx:20015/login"></to>
</route>
现在,在收到来自 restlet 的请求后,camel 处理器并没有去 http://xx.xx.xx.xx:20015/login
而是尝试访问不存在的 http://localhost/v1/authentication/initiate
,因此我得到 404 HTTPOperation failed like:
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost/v1/authentication/initiate with statusCode: 404
at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:228) ~[camel-http-2.12.4.jar:2.12.4]
at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:156) ~[camel-http-2.12.4.jar:2.12.4]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[camel-core-2.12.4.jar:2.12.4]
我在其他地方的路由都能正常使用。但不知道为什么它没有到达此路由定义中的预期目的地 url。
请帮忙。
移除 CamelHTTP headers restlet 在调用 HTTP 端点时可能会产生噪音。
查看此常见问题解答:http://camel.apache.org/how-to-remove-the-http-protocol-headers-in-the-camel-message.html
我的骆驼路线类似于:
<camel:routeContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="restlet:/v1/authentication/initiate?restletMethod=post&restletBinding=#queryStringToHeadersRestletBinding"/>
<to uri="http://xx.xx.xx.xx:20015/login"></to>
</route>
现在,在收到来自 restlet 的请求后,camel 处理器并没有去 http://xx.xx.xx.xx:20015/login
而是尝试访问不存在的 http://localhost/v1/authentication/initiate
,因此我得到 404 HTTPOperation failed like:
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost/v1/authentication/initiate with statusCode: 404
at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:228) ~[camel-http-2.12.4.jar:2.12.4]
at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:156) ~[camel-http-2.12.4.jar:2.12.4]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[camel-core-2.12.4.jar:2.12.4]
我在其他地方的路由都能正常使用。但不知道为什么它没有到达此路由定义中的预期目的地 url。 请帮忙。
移除 CamelHTTP headers restlet 在调用 HTTP 端点时可能会产生噪音。
查看此常见问题解答:http://camel.apache.org/how-to-remove-the-http-protocol-headers-in-the-camel-message.html