12.2 消息群组

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1752.html

12.2 Message groups

12.2 消息群组

We can refine the exclusive consumer concept further with message groups. Instead

of all messages going to a single message consumer, messages can be grouped

together for a single consumer, and a message producer can designate a group for a

message by setting the message header JMSXGroupID. The ActiveMQ broker will

ensure that all messages with the same JMSXGroupID are sent to the same consumer, as

shown in figure 12.3.

扫描二维码关注公众号,回复: 670125 查看本文章

消息群组是排他性消息消费者概念的进一步完善.不同于将所有消息都发送到单一的消费者,消息可以被

分组,同一组消息会发送到同一个消费者,并且消息生产者通过设置消息头中的JMSXGroupID值给消息

分组.ActiveMQ代理确保JMSXGroupID值相同的消息会被发送到相同的消费者,如图12.3所示.

If the consumer designated by the ActiveMQ broker to receive messages for a given

JMSXGroupID should close or become unavailable (a network outage, for example),

then the ActiveMQ broker will select a different message consumer to dispatch the

grouped messages to.

..................

猜你喜欢

转载自jackyin5918.iteye.com/blog/1993121