@Override
public void configure() {
from("timer?period=12000&repeatCount=1")
.log("started")
.streamCaching()
.to("sql:select * from TABLE WHERE ROWNUM < 100" +
"?dataSource=#dataSource")
.split()
.body()
.process(new convertToJSON())
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.setHeader(Exchange.CONTENT_TYPE, constant("text/html"))
.to(url)
.end()
.log("Sent");
}
我有这条骆驼路线,效果很好,但在控制台中收到警告:
2019-05-30 16:02:51.856 WARN 11284 --- [- timer://timer] o.a.c.language.simple.SimpleLanguage : Simple language is using deprecated syntax: body. You should migrate to use newer syntax that uses ${xxx} style.
如何解决此警告?
答案 0 :(得分:1)
如果要访问交换正文,则应在简单表达式中使用“ $ {body}”。
例如:
.log("${body}")
以上内容将记录交换的主体。