|
@ -39,23 +39,21 @@ public class CamelStartBoot {
|
|
|
logger.info("Apache Camel Context 启动...");
|
|
|
|
|
|
try {
|
|
|
context.setStreamCaching(true); //确保outBody可以消费多次。参考链接:http://camel.apache.org/why-is-my-message-body-empty.html
|
|
|
context.setUseMDCLogging(true);
|
|
|
|
|
|
Tracer tracer = new Tracer();
|
|
|
tracer.setTraceOutExchanges(true);
|
|
|
|
|
|
DefaultTraceFormatter formatter = new TracerFormatter();
|
|
|
formatter.setShowHeaders(true);
|
|
|
formatter.setShowBody(true);
|
|
|
formatter.setShowBodyType(true);
|
|
|
formatter.setShowOutHeaders(true);
|
|
|
formatter.setShowOutBody(true);
|
|
|
formatter.setShowOutBodyType(true);
|
|
|
tracer.setFormatter(formatter);
|
|
|
|
|
|
context.addInterceptStrategy(tracer);
|
|
|
context.setTracing(true);
|
|
|
// 添加一下代码, 代理到mgr, mgr接收不到文件....注释掉..
|
|
|
// context.setStreamCaching(true); //确保outBody可以消费多次。参考链接:http://camel.apache.org/why-is-my-message-body-empty.html
|
|
|
// context.setUseMDCLogging(true);
|
|
|
// Tracer tracer = new Tracer();
|
|
|
// tracer.setTraceOutExchanges(true);
|
|
|
// DefaultTraceFormatter formatter = new TracerFormatter();
|
|
|
// formatter.setShowHeaders(true);
|
|
|
// formatter.setShowBody(true);
|
|
|
// formatter.setShowBodyType(true);
|
|
|
// formatter.setShowOutHeaders(true);
|
|
|
// formatter.setShowOutBody(true);
|
|
|
// formatter.setShowOutBodyType(true);
|
|
|
// tracer.setFormatter(formatter);
|
|
|
// context.addInterceptStrategy(tracer);
|
|
|
// context.setTracing(true);
|
|
|
|
|
|
context.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");
|
|
|
|