骆驼HTTP如何

骆驼HTTP如何,http,apache-camel,Http,Apache Camel,任何人都能帮我理解为什么这不起作用 <route> <from uri="restlet:/foo"/> <setHeader headerName="CamelHttpBaseUri"> <simple>http://www.google.com</simple> </setHeader&

任何人都能帮我理解为什么这不起作用

   <route>
            <from uri="restlet:/foo"/>
            <setHeader headerName="CamelHttpBaseUri">
                        <simple>http://www.google.com</simple>
                    </setHeader>
            <to uri="http://dummyhost"/>
            <to uri="mock:result"/>
</route>

http://www.google.com

我的期望是,通过设置CamelHttpBaseUri(Exchange.HTTP_-URI),端点中的URL将被忽略,并使用头。但这并没有发生。我遗漏了什么?

Exchange.HTTP_-URI
CamelHttpUri
,而不是
CamelHttpBaseUri
,至少在Camel 2.10.x.HTTP_-URI是
CamelHttpBaseUri
,至少在Camel 2.10.x.这是我的错误。您是否介意添加您的评论作为答案,以便我可以接受?您也可以使用Exchange.HTTP_URI作为XML中的标题名。骆驼会发现这一点。然后,您可以使用与Java代码中相同的常量。是的,这也适用。非常感谢。