Ver código fonte

代理到mgr,接收不到文件

chenyongxing 6 anos atrás
pai
commit
f5357d9384

+ 15 - 17
src/main/java/com/yihu/hos/broker/services/camel/CamelStartBoot.java

@ -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");

+ 2 - 2
src/main/resources/application.yml

@ -13,7 +13,7 @@ camel:
spring:
  profiles: dev
  activemq:
    broker-url: tcp://172.19.103.42:61616
    broker-url: tcp://172.19.103.57:61616
    user: admin
    password: admin
  data:
@ -30,7 +30,7 @@ log:
  level: info
hos:
  filesystem:
    url: http://172.19.103.57:9010/dfs/file
    url: http://172.19.103.58:9010/dfs/file
  arbiter:
    enable: true
    url: http://localhost:10135

+ 2 - 2
src/main/resources/logback-spring.xml

@ -38,8 +38,8 @@
        <InitialContextFactoryName>
            org.apache.activemq.jndi.ActiveMQInitialContextFactory
        </InitialContextFactoryName>
        <!--<ProviderURL>tcp://192.168.200.60:61616</ProviderURL>-->
        <ProviderURL>tcp://172.19.103.57:61616</ProviderURL>
        <!--<ProviderURL>tcp://192.168.200.60:61616</ProviderURL>--><!--上饶正式线配置 -->
        <ProviderURL>tcp://172.19.103.57:61616</ProviderURL><!--本地,测试线配置 -->
        <userName>admin</userName>
        <password>admin</password>
        <TopicConnectionFactoryBindingName>ConnectionFactory</TopicConnectionFactoryBindingName>