Apache Camel:使用Java DSL为处理器设置“说明”

时间:2018-08-13 06:38:03

标签: apache-camel

我可以将自定义iddescription添加到<log>或XML的大多数其他类型的处理器中,如下所示:

<log message="Hello" id="logId">
  <description>Description of logging</description>
</log>

我试图用Java DSL做类似的事情:

from("direct:1")
  .log("Hello")
  .id("logId")
  .description("Description of logging")

但是说明仅适用于路由,而不适用于处理器。 (提供了routeId()方法,将id应用于路由而不是处理器。)

通过浏览骆驼的源代码,ProcessorDefinition的{​​{1}}定义有很多代码可将其应用于最后一个块或输出,并带有以下注释:

id()

// set it on last output as this is what the user means to do // for Block(s) with non empty getOutputs() the id probably refers // to the last definition in the current Block 中没有description()的类似定义,因此此更简单的方法继承自ProcessorDefinition

OptionalIdentifiedDefinition

在我看来,Java DSL没有提供为public T description(String text) { if (text != null) { if (description == null) { description = new DescriptionDefinition(); } description.setText(text); } return (T) this; } 或其他处理器设置description的方法。这是真的,还是我错过了什么?

(如果是真的,我是否应该开发补丁来改善DSL?)

0 个答案:

没有答案