[英]How to URL-encode the the whole xml value of a query param using Spring's rest template?
[英]how to set dynmic query param value on rest camel xml routing
我有像下面這樣的駱駝路由,在日志上我可以打印“更新 ID:1113”,但是當使用查詢參數調用休息服務時,我無法獲得 ${property.id} 的值。 登錄休息服務器 = "/test/update?id=$%7Bproperty.id%7D"。 如何在駱駝休息 xml 路由中動態傳遞查詢參數值?
<camel:setProperty propertyName="id">
<camel:jsonpath>$.id</camel:jsonpath></camel:setProperty>
<camel:log logName="Fuse_Service" message="update Id : ${property.id}"/>
<simple>${property.http_method} == 'PUT'</simple>
<camel:setHeader headerName="Content-Type"><constant>application/json</constant>
</camel:setHeader>
<camel:setHeader headerName="CamelHttpMethod"><constant>PUT</constant>
</camel:setHeader>
<setHeader headerName="CamelHttpQuery">
<constant>id=${property.id}</constant>
</setHeader>
<camel:to uri="http4://{{test.api.url}}/test/update" />
我使用常量元素是我的錯誤:
<常量>id=${property.id}</常量>。
正確的做法是使用簡單的元素
<簡單> id=${property.id} </簡單>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.