(骆驼2.9.2)
非常简单的用例,但我似乎无法找到答案.我的代码归结为:
String user = "user";
String password = "foo&bar";
String uri = "smtp://hostname:25?username=" + user +
"&password=" + password +
"&to=somthing@something.com"; // etc. You get the idea
from("seda:queue:myqueue").to(uri);
Run Code Online (Sandbox Code Playgroud)
Camel抛出ResolveEndpointFailedException并显示"Unknown parameters = [{bar = null}]".
如果我尝试"foo%26bar",我会得到相同的结果.
如果我尝试"foo& bar",骆驼会回答"未知参数= [{amp; bar = null}]."
我尝试使用URISupport创建URI.它将&转移到%26,然后我再次得到"Unknown parameters = [{bar = null}]".
有任何想法吗?
小智 9
从Camel 2.11开始,您可以使用原始语法
例如:
.to("ftp:joe@myftpserver.com?password=RAW(se+re?t&23)&binary=true"
在上面的示例中,我们将密码值声明为raw,并将实际密码设置为type,例如se + re?t&23
https://cwiki.apache.org/confluence/display/CAMEL/How+do+I+configure+endpoints
| 归档时间: |
|
| 查看次数: |
2423 次 |
| 最近记录: |