简体   繁体   English

ActiveMQ:如何在多个Message Broker实例之间平衡负载?

[英]ActiveMQ: how to balance the load across multiple Message Broker instances?

Just walked through these docs: 刚刚浏览了以下文档:

  • http://activemq.apache.org/failover-transport-reference.html <--- As I understood, failover allows Producer and Consumer to produce/consume a secondary queue only if first becomes unavailable and return to the primary one as soon as it's back again. http://activemq.apache.org/failover-transport-reference.html <---据我了解,故障转移允许生产者和使用者仅在第一个队列不可用时才生产/使用第二个队列,并尽快返回到主队列。因为它又回来了。 This behaviour is definitely NOT load balancing. 此行为绝对不是负载平衡。
  • http://activemq.apache.org/networks-of-brokers.html <--- They provide some approaches how to replicate messages across multiple Broker instances there. http://activemq.apache.org/networks-of-brokers.html <---他们提供了一些方法来跨多个Broker实例复制消息。 If one goes down, the clients can automatically failover to a slave which will have all the messages already, so each message is highly available. 如果出现故障,客户端可以自动故障转移到将拥有所有消息的从属服务器,因此每条消息都是高度可用的。 But this is not what I'm expecting too. 但这也不是我所期望的。

So, Is it possible to configure Consumer and Producer applications to connect and balance the load between multiple broker instances (in Round Robin or similar way)? 因此,是否可以配置Consumer和Producer应用程序以连接并平衡多个代理实例之间的负载(以Round Robin或类似方式)?

this is what the network of brokers in store and forward mode is designed to do... queues are distributed for load balancing (note: this is not HA however...if a broker goes down, its messages are stuck in the message store until the broker is restarted, need master/slave for HA) 这是存储和转发模式下的代理网络的设计目标。... 分配队列以进行负载平衡(注意:这不是HA,但是...如果代理发生故障,其消息将停留在消息存储中直到代理重新启动,才需要HA的主/从服务器)

if we had broker A, B, C and a publisher on a queue on A. If we have consumers on the queue on A and B then messages for the queue will be spread across both brokers A and B; 如果我们在A和B上的队列中有使用者,则队列A中的消息将在经纪人A和B中传播; some messages going to B, some being consumed on A, none going to C. If a consumer on the queue starts on C, then messages will flow there too. 一些消息发送到B,有些消息在A上使用,而没有消息发送到C。如果队列中的使用者从C开始,那么消息也将在那里流动。 If the consumer stops then no more messages will be dispatched to C. 如果使用者停止,则不会再有消息发送给C。

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

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