【问题标题】:apache camel hybrid componentapache骆驼混合组件
【发布时间】:2020-04-01 14:18:35
【问题描述】:

我想知道是否有可能在可以接受两个不同组件的路线中使用骆驼组件。 比如:

from("abc-component:queue.name.a")
   .doSomething
   .to("def-component:queue.name.b")

abc-component 将同时接受 jms-component 和 file-component

【问题讨论】:

  • 我记得文档中有确切的场景,pollEnrich()
  • 你的要求不是很清楚。你能解释一下你的用例吗?当你说它接受 jms 和文件组件时,你到底是什么意思?

标签: java spring spring-boot apache-camel


【解决方案1】:

是的,如果需要,您可以自己实现此类组件。不,Apache Camel 中没有这样的组件 OOTB。用direct route分隔常用逻辑也可以达到同样的效果。

from("jms:something")
    .to("direct:common_logic");

from("file:somewhere")
    .to("direct:common_logic");

from("direct:common_logic")
    //do something
    .to("log:hi");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-08
    相关资源
    最近更新 更多