Apache骆驼作为代理和查询参数

问题描述 投票:1回答:2

我正在尝试构建一个非常简单的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发送到真实服务器,如果有参数,则不发送它们。

有人可以解释这种现象的原因吗?

即使没有请求参数,我如何强制骆驼不发送端点参数?

apache-camel
2个回答
0
投票

似乎这是骆驼码头组件中的错误。替换

<to uri="jetty:http://realserverhostname:8090/myapp?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>

<to uri="http://realserverhostname:8090/myapp?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>

<to uri="http4://realserverhostname:8090/myapp?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>

将解决问题。

已在码头组件https://issues.apache.org/jira/browse/CAMEL-10064上创建了一个错误


0
投票

我在REST组件中看到了相同的行为。这也是一个已知问题吗?

© www.soinside.com 2019 - 2024. All rights reserved.