이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 22. Message Grouping


A message group is a group of messages that share certain characteristics:

  • All messages in a message group are grouped under a common group id. This means that they can be identified with a common group property.
  • All messages in a message group are serially processed and consumed by the same consumer, irrespective of the number of customers on the queue. This means that a specific message group with a unique group id is always processed by one consumer when the consumer opens it. If the consumer closes the message group, then the entire message group is directed to another consumer in the queue.

Message groups are especially useful when there is a need for messages with a certain value of the property (group id) to be processed serially by a single consumer.

Important

Message grouping will not work as expected if the queue has paging enabled. Be sure to disable paging before configuring a queue for message grouping.

For information about configuring message grouping within a cluster of messaging servers, see Clustered Message Grouping in Part III, Configuring Multiple Messaging Systems.

22.1. Configuring Message Groups Using the Core API

The property _AMQ_GROUP_ID is used to identify a message group using the Core API on the client side. To pick a random unique message group identifier, you can also set the auto-group property to true on the SessionFactory.

22.2. Configuring Message Groups Using JMS

The property JMSXGroupID is used to identify a message group for Java Messaging Service (JMS) clients. If you wish to send a message group with different messages to one consumer, you can set the same JMSXGroupID for different messages.

Message message = ...
message.setStringProperty("JMSXGroupID", "Group-0");
producer.send(message);

message = ...
message.setStringProperty("JMSXGroupID", "Group-0");
producer.send(message);
Copy to Clipboard Toggle word wrap

An alternative approach is to use the one of the following attributes of the connection-factory to be used by the client: auto-group or group-id.

When auto-group is set to true, the connection-factory will begin to use a random unique message group identifier for all messages sent through it. You can use the management CLI to set the auto-group attribute.

/subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=auto-group,value=true)
Copy to Clipboard Toggle word wrap

The group-id attribute will set the property JMSXGroupID to the specified value for all messages sent through the connection factory. To set a specific group-id on the connection factory, use the management CLI.

/subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=group-id,value="Group-0")
Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동