Scenario
In RocketMQ, you may need to create a subscription group in the following scenarios:
l Message load balancing: When a topic has a large number of messages, you can create multiple consumers and add them to the same subscription group. RocketMQ evenly distributes messages to consumers in the subscription group based on their load balancing policies, achieving load balancing of messages.
l HA: To improve consumer availability and fault tolerance, you can create multiple consumers and add them to the same subscription group. When one consumer fails or stops running, RocketMQ re-distributes the messages of the consumer to other consumers in the subscription group, achieving HA.
l Consumer scale-out: To improve consumption, you can create multiple consumers and add them to the same subscription group. RocketMQ evenly distributes messages to consumers in the subscription group based on the number of consumers and the load balancing policy, improving consumption.
l Consumer group management: You can create a subscription group to manage a group of consumers with the same consumption logic. For example, you can group consumers with the same business logic and configure different consumption policies, consumption progress and other parameters for subscription groups.
Note: Specify a unique name when creating a subscription group for identification and management by RocketMQ. A subscription group can subscribe to one or more topics to meet the requirements of different business scenarios.
To sum up, you can create subscription groups to enable message load balancing, HA, and consumer scale-out, and simplify management and configuration of consumer groups.
Add New Subscription Group
1. Go to the subscription management menu and click Create.
2. Fill in the corresponding fields in the pop-up window.
(1) The current cluster name is displayed by default and cannot be changed.
(2) Enter the subscription group name. A name contains 2 to 64 characters and will fail to be created if it exceeds the length limit. The name of a user-created subscription group can only consist of uppercase and lowercase letters, numbers, underscores (_) and hyphens (-).
(3) Fill in the topic remarks as required.
(4) Select the broker where the subscription group is located and list each broker based on the number of the master-slave node pairs that you have selected when creating an instance, which can be checked.
(5) Select whether to enable consumption, which is enabled by default.
3. After entering the subscription group information, save and confirm it. A subscription group is created.
4. To create subscription groups in batch, click Batch Create.
l Bulk Creation
Note: The subscription group name that you have entered should not contain special characters such as spaces.
Batch create subscription groups by uploading the CSV format template. Format: Click Subscription Group Template for download.
l Subscription Group Template
You must use the template to batch upload subscription groups successfully.