我创建了一个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();
但是,我无法获取消息日志并调试路由。路由是否存在问题,或者日志文件或其他任何问题?