使用多代理 ActiveMQ artemis 实例进行负载平衡
我需要您的帮助来建议我如何使用下图最好地实现负载平衡。在这里,我尝试使用 Master 创建 2 台机器,并期望消费者/发布者应用程序将使用一个通用 URL(负载平衡的 URL),其中我不应该公开单个 VM 机器信息和端口 ID。只是负载均衡器应该负责路由..
这通常是我们在 F5 负载均衡器或 HTTP 负载均衡器的帮助下所做的事情..只是想知道可以通过 ActiveMQ 实现及其建议吗..?
另一方面,我也尝试在weblogic上配置这种方式来使用ActiveMQ队列中的数据 failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=true 但这没有帮助..或者WebLogic不理解这种格式。
I need your help to suggest me how best I can achieve load balancing using the below diagram. here I am trying to create 2 machines with Master and expecting that the consumer/publisher application will use one common URL( a load-balanced one), where I should not expose the individual VM machine info and port ID. just that load balancer should take care of routing..
this is typically what we do with help of F5 load balancer or HTTP load balancer ..just wondering can be achieved over ActiveMQ and its advisable..?
on other side, I also tried configuring this way on weblogic to consume data from ActiveMQ queue
failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=true but this does not help.. or WebLogic is not understanding this format.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
消息连接是有状态的。它们不像 HTTP 连接那样无状态,因此不能像 HTTP 连接那样进行负载平衡。 也许可以配置 F5 来处理有状态消息连接,但我不能肯定。我不是 F5 专家。
ActiveMQ Artemis 代理本身以及代理附带的 JMS 客户端都内置了负载平衡功能。这里要介绍的内容太多,所以我建议您 查看集群文档以获取相关详细信息。
您也可以尝试使用经纪商平衡器特征。它目前处于实验阶段,但应该可以在 3 月/4 月发布的 2.21.0 版本中使用。它可以像消息连接的 F5 一样,但它可以做一些更智能的事情,例如始终将某些客户端发送到同一节点,这可以促进传统集群中不可能实现的某些用例。 (请参阅下面的更新)
您使用的 URL
failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=true
适用于 ActiveMQ 5.x 附带的 OpenWire JMS 客户端。如果您使用的是 ActiveMQ Artemis 附带的核心 JMS 客户端,那么您应该使用如下 URL:Broker Balancer 功能的生产准备情况更新:
从版本 2.21.0 开始,此功能已完成并纳入最新文档池,标题为“连接路由器”(撰写本文时为 2.30.0)。
上面的链接也已更新,以反映该功能位于标题 Broker Balancer (2.20.0) 下的文档池中的最新版本
Messaging connections are stateful. They are not stateless like HTTP connections, and therefore cannot be load-balanced in the same way as HTTP connections. It may be possible to configure an F5 to deal with stateful messaging connections, but I can't say for sure. I'm not an expert on F5.
Both the ActiveMQ Artemis broker itself as well as the JMS client shipped with the broker have load-balancing functionality built in. There's too much to cover here so I recommend you review the clustering documentation for the relevant details.
You might also try using the broker balancer feature. It's currently experimental, but it should be ready to use in the 2.21.0 release coming in the March/April time-frame. It can act like an F5 for your messaging connections, but it can do some more intelligent things like always sending certain clients to the same node which can facilitate certain use-cases which are not possible in a traditional cluster. (See update below)
The URL
failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=true
which are you using is for the OpenWire JMS client shipped with ActiveMQ 5.x. If you're using the core JMS client shipped with ActiveMQ Artemis then you should be using a URL like this instead:Update on production readiness of the Broker Balancer feature:
As of version 2.21.0, this feature has been completed and incorporated into the latest documentation pool with title Connection Routers (2.30.0 at the time of this writing).
Above link is also updated to reflect the latest version that the feature lived in the documentation pool under title Broker Balancer (2.20.0)