我正在尝试构建一个非常简单的HTTP代理,就像http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html中所述。
我使用wireshark确切地了解发生了什么。
当我在http://localhost:8080/myapp
上进行请求时,发送到真实服务器的请求是http://realserverhostname:8090/myapp?bridgeEndpoint=true&throwExceptionOnFailure=false
。
[当我执行参数化请求http://localhost:8080/myapp?toto=tata
时,发送到真实服务器的请求为http://realserverhostname:8090/myapp?toto=tata
。
因此,当没有请求参数时,会将端点参数bridgeEndpoint=true&throwExceptionOnFailure=false
发送到真实服务器,如果有参数,则不发送它们。
有人可以解释这种现象的原因吗?
即使没有请求参数,我如何强制骆驼不发送端点参数?
似乎这是骆驼码头组件中的错误。替换
<to uri="jetty:http://realserverhostname:8090/myapp?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
与
<to uri="http://realserverhostname:8090/myapp?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
或
<to uri="http4://realserverhostname:8090/myapp?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
将解决问题。
已在码头组件https://issues.apache.org/jira/browse/CAMEL-10064上创建了一个错误
我在REST组件中看到了相同的行为。这也是一个已知问题吗?