2014-11-25 48 views

回答

1

使用傳統的查詢參數,駱駝URI如下所示:

from("direct:start") 
    .to("http4://oldhost?order=123&detail=short"); 

因此,使用矩陣參數應該工作以及:

from("direct:start") 
    .to("http4://oldhost;order=123;detail=short"); 

編輯:

使用Exchange.HTTP_URI動態設置的屬性,或使用recipientList如:

from("direct:start") 
    .recipientList(simple("http4://oldhost;order=${header.123Header};detail={{value.from.cfg}}")); 
+0

我在一些其他的方式解決了這個問題。我想要的是從.cfg中讀取我的Matrix Params的值或從某些標題中獲取這些值。我無法執行以下操作:to(「http4:// oldhost; order = $ {headers.123Header}; detail = {{value.from.cfg}}」)。爲了使這成爲可能,我使用了Exchange.HTTP_URI標頭,它將用我在那裏指定的值替換我的實際休息端點。是不是一個乾淨的解決方案:(但它的工作原理。我期望駱駝有一個矩陣參數的標題與查詢參數類似。謝謝你的答案。 – Roxana 2014-12-17 09:49:21

+0

@Roxana另外,你可以使用'recipientList',看我的答案如何這可以做到。 – 2014-12-20 15:02:01