2014-11-04 76 views
0

我有一个问题,让身体在restlet上。我在Apache Camel的路线是:Apache Camel Restlet生产者主体密钥

from("timer:msgGen?period=2000") 
    .setBody(simple("A Test")) 
    .to("restlet:http://localhost:8888/?restletMethod=POST"); 

localhost:8888 is fiddler。 (http://www.telerik.com/fiddler

上的提琴手其余-回应是:

A%20Test&breadcrumbId=ID-W530-60491-1415112773228-0-11&firedTime=Tue%20Nov%2004%2015%3A53%3A06%20CET%202014 

编码,以更好地阅读:

A Test&breadcrumbId=ID-W530-60491-1415112773228-0-11&firedTime=Tue Nov 04 15:53:06 CET 2014 

但我认为这是必须做到:

body=A Test&breadcrumbId=ID-W530-60491-1415112773228-0-11&firedTime=Tue Nov 04 15:53:06 CET 2014 

的关键“身体”不见了,还是我误解了?

它是一个错误或功能?我该如何解决这个问题?获得一个键值对?

谢谢

+0

您没有设置响应这是从身体开始。骆驼restlet生产者不会添加body = there。 – 2014-11-05 08:07:02

回答

0

好吧,我解决了这个问题:

from("timer:msgGen?period=2000") 
    .setBody(simple("A Test")) 
    .to("http4://localhost:8888/"); 

这Maven依赖你需要:

<dependency> 
    <groupId>org.apache.camel</groupId> 
    <artifactId>camel-http4</artifactId> 
    <version>2.14.0</version> 
</dependency> 

感谢您的帮助