我创建了一个 Camel Context 实例,并在上下文中添加了如下路由:
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
System.out.println("in add route method");
from("direct:start").routeId("contextRoute")
.setHeader("client_id", constant("abc"))
.setHeader("client_secret", constant("clk"))
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
.setHeader(Exchange.HTTP_URI, constant(url))
.marshal(gsonDataFormat)
.log("trying to send message")
.to(url)
.log("response is ${body}");
}
});
camelContext.start();
但是我无法获取我的消息日志并调试路由。路由有问题还是日志文件有问题?