【问题标题】:How to retrieve a exchange property in the camel route XML?如何在骆驼路线 XML 中检索交换属性?
【发布时间】:2017-01-18 06:03:23
【问题描述】:

我必须在路线中运行一个循环。我的路线看起来像

<camel:loop>
      <camel:constant>${property.x}</camel:constant> 
</camel:loop>

我的处理器看起来像

Date date = new Date();
    this.LOGGER
            .info("\n****WELCOME TO THE REQUEST OF CHECK PROCESSOR**");
    int y=4;
    Integer a=new Integer(y);
    exchange.setProperty(x,a);
    int k=(Integer) exchange.getProperty(x);
    this.LOGGER
    .info("\n***WELCOME TO THE REQUEST OF CHECK PROCESSOR ENDINGGGGGGGG***"+"a=   "+a+"  Y=  "+y+"  x=   "+exchange.getProperty(x)+"  k=  "+k);

运行时 x= 4 的值。我想在骆驼路线 XML 文件中访问这个 x。

【问题讨论】:

    标签: java xml apache-camel


    【解决方案1】:

    你必须使用simple语言而不是constant,正确的语法是${properties:x}

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多