简体   繁体   English

阿帕奇骆驼混合组件

[英]apache camel hybrid component

I'd like to know if it's possible to have a camel component in a route that could accept two different components.我想知道是否有可能在可以接受两个不同组件的路线中使用骆驼组件。 Something like:就像是:

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

and the abc-component will accept both a jms-component and a file-component并且 abc 组件将同时接受 jms 组件和文件组件

Yes, you can implement such component yourself if you need that.是的,如果需要,您可以自己实现此类组件。 No, there is not such component OOTB in Apache Camel.不,Apache Camel 中没有这样的组件 OOTB。 You can achieve the same result by separating common logic with direct route .您可以通过将公共逻辑与direct路由分开来实现相同的结果。

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

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM