gpt4 book ai didi

apache-camel - Apache Camel 是否支持 activemq 通配符消费者?

转载 作者:行者123 更新时间:2023-12-04 18:41:22 26 4
gpt4 key购买 nike

我需要一种方法来消费来自多个 activemq jms 队列的消息。

根据 activemq 文档,它支持 wildcard consumers

我使用 Camel 作为消息总线。是否可以查看下面的命名队列

aaa.processQueue
bbb.processQueue
ccc.processQueue

通过配置camel route看 activemq:*.processQueue终点?

也让我知道,如果有更清洁的替代品。

最佳答案

是的。这应该是可行的,因为 Camel 使用的是 OpenWire/JMS 客户端。

您的选择是:

  • from("activemq:*.processQueue")
  • from("activemq:aaa.processQueue,bbb.processQueue,ccc.processQueue")
  • 具有逻辑子路由的多条路由:
    from("activemq:aaa.processQueue").to("direct:doProcess");
    from("activemq:bbb.processQueue").to("direct:doProcess");
    from("activemq:ccc.processQueue").to("direct:doProcess");

    from("direct:doProcess").whatever..

    通过这种方式,您可以轻松地打开/关闭路由并将更多消费者分配给一个,因为您需要在 aaa.processQueue 上拥有更多优先级。消息比其余的。
  • 关于apache-camel - Apache Camel 是否支持 activemq 通配符消费者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25333648/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com