ActiveMQ Artemis消息分组leader选举

ActiveMQ Artemis message grouping leader election

我们正在使用 ActiveMQ Artemis 节点集群,我们想使用消息分组功能。 从文档中,我们了解到我们需要确定 1 个节点作为此功能的主节点。有没有办法让这个选举由集群本身自动动态地完成?

如果没有,假设我们自己做,有没有办法动态更改节点的消息分组设置而无需重新启动它?

我们正在使用 EmbeddedActiveMQ。

问候 尼古拉斯

无法动态“选择”将做出消息分组决策的节点。它必须静态配置。此外,如果不重新启动代理,则无法更改配置。

也就是说,我鼓励您查看来自 ActiveMQ Artemis documentation 的这篇注释:

In general, combining clustering and message grouping is a poor choice because the fundamental ideas of grouped (i.e. ordered) messages and horizontal scaling through clustering are essentially at odds with each other.

Message grouping enforces ordered message consumption. Ordered message consumption requires that each message be fully consumed and acknowledged before the next message in the group is consumed. This results in serial message processing (i.e. no concurrency).

However, the idea of clustering is to scale brokers horizontally in order to increase message throughput by adding consumers which can process messages concurrently. But since the message groups are ordered the messages in each group cannot be consumed concurrently which defeats the purpose of horizontal scaling.