2015-06-08 84 views
2

我遇到問題通過駱駝收件人列表(2.14)擊中http端點。駱駝HTTP終點特殊Charcter(+)問題

<route id="httpexecutor"> 
     <from uri="direct:httpexecutor" /> 
     <process ref="httpPreprocessor" /> 
     <recipientList> 
      <simple>${property[inputSearchParameter.url]}</simple> 
     </recipientList> 
</route> 

當url有+符號(在其中一個參數中),那麼它的破壞。 我也嘗試%2B,然後它被轉換爲空間。

有一個JIRA: https://issues.apache.org/jira/browse/CAMEL-6176

然而,當我使用RAW其沒有工作,得到下面的跟蹤(好像RAW傳遞給服務):

Caused by: java.net.URISyntaxException: Illegal character in query at index 558: http://someurl?facet=true&binary=true&-fq=nm_task_type%3A%28OTM_QUERY+OR+OTM_CLIENT_QUERY%29&facet.query=%7B%21key%3D%22%5B*+TO+NOW-30%5D%22%7Ddt_created%3A%5B*+TO+NOW-30DAY%5D&facet.query=%7B%21key%3D%22%5BNOW-30DAY+TO+NOW-15DAY%5D%22%7Ddt_created%3A%5BNOW-30DAY+TO+NOW-15DAY%5D&facet.query=%7B%21key%3D%22%5BNOW-15DAY+TO+NOW-7DAY%5D%22%7Ddt_created%3A%5BNOW-15DAY+TO+NOW-7DAY%5D&facet.query=%7B%21key%3D%22%5BNOW-7DAY+TO+NOW-1DAY%5D%22%7Ddt_created%3A%5BNOW-7DAY+TO+NOW-1DAY%5D&facet.query=RAW({!key="[NOW-1DAY TO NOW]"}dt_created:[NOW-1DAY TO NOW+1DAY])&q=*%3A*&rows=0 
    at java.net.URI$Parser.fail(URI.java:2829) 
    at java.net.URI$Parser.checkChars(URI.java:3002) 
    at java.net.URI$Parser.parseHierarchical(URI.java:3092) 
    at java.net.URI$Parser.parse(URI.java:3034) 
    at java.net.URI.<init>(URI.java:595) 
    at org.apache.camel.util.URISupport.createURIWithQuery(URISupport.java:334) 
    at org.apache.camel.util.URISupport.createRemainingURI(URISupport.java:428) 
    at org.apache.camel.component.http.HttpComponent.createEndpoint(HttpComponent.java:248) 
    at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:122) 
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:525) 
    ... 52 more 

任何幫助appeciated 。

+0

%20是+的替代品,當+代表一個空間 –

+0

哦... K .....任何想法如何我可以得到+運行.....我在看源代碼和RAW甚至沒有用在上面的方法中跟蹤....如何可以我通過駱駝收件人列表獲得+運行 – Thomas

+0

我試過%2B而不是%20。另外+也是我的參數的一部分:facet.query = {!key =「[NOW-1DAY TO NOW]」} dt_created:[NOW-1DAY TO NOW + 1DAY] NOW + 1 - > not came with camel – Thomas

回答

1

我沒有測試過這一點,但你能傳遞給駱駝HTTP成分,看看它是否有助於前頭「CamelHttpPath」設爲您的網址:

<setHeader headerName="CamelHttpPath"> 
    <simple>YOUR_URL</simple> 
</setHeader>