【发布时间】:2016-10-12 05:29:45
【问题描述】:
我需要能够轮询 Rest WebService 并作为该调用的一部分传递来自 WebService 的最后一个响应的 id。我知道要在 Camel 中使用动态端点,您需要使用 Enrich 处理器,但我无法进行更新。
请考虑以下简单案例:
public class MyRoute extends RouteBuilder {
long id;
@Override
public void configure() throws Exception {
from("timer://foo?fixedRate=true&period=3000")
.enrich().simple("http://localhost:8080/TestRestSource/test/result/" + id)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
id++;
System.out.println("--- " + id);
}
})
.end();
}
}
我正在使用 Camel 2.16。
任何帮助将不胜感激。
提前致谢,
克里斯
【问题讨论】:
-
那么,你得到了什么错误?
标签: rest apache-camel