This topic describes how to create and delete groups and view group details in the ApsaraMQ for RocketMQ console.
Background information
A group contains producers or consumers that produce or consume messages of the same type based on the same logic. To use ApsaraMQ for RocketMQ to produce or consume messages, you must create groups to identify producer instances or consumer instances of the same type.Limits
- You can create up to 1,000 groups in an instance. We recommend that you reuse groups or delete groups that are not used at the earliest opportunity. If you want to increase the limit on groups, contact ApsaraMQ for RocketMQ technical support.
- Each group can be used in only one instance. For example, a group that is created in Instance A cannot be used in Instance B.
- In ApsaraMQ for RocketMQ, consumer groups can consume messages over HTTP or TCP. Different consumer groups can use different protocols. We recommend that you create a group for each protocol.
- If multiple consumers in the same group consume messages over different protocols, message consumption may fail, and message duplication or message loss may occur.
- Approximately 1 to 2 hours is required to change the protocol that is used by the consumers in a group.
- If the consumers in a group consume messages by using a protocol that is different from the protocol displayed in the console, the data displayed in the console can be inaccurate. This does not affect the messaging of the group. You can contact ApsaraMQ for RocketMQ technical support to change the protocol that is displayed in the console to the protocol that is being used for the group.
- A group ID must be specified for each consumer. You do not need to specify a group ID for each producer.
Naming conventions for group IDs
- A group ID must be 2 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_). We recommend that you include the prefix GID_ or GID- in a group ID.
- If the instance in which a group resides has a namespace, the ID of the group must be unique in the instance. The group ID cannot be the same as an existing group ID or topic name in the instance. Group IDs and topic names in different instances can be the same. For example, a group ID in Instance A can be the same as a group ID or a topic name in Instance B.
- If the instance in which a group resides does not have a namespace, the ID of the group must be globally unique across instances and regions. This means that the ID of the group cannot be the same as an existing group ID or topic name in Message Queue for Apache RocketMQ within your Alibaba Cloud account.
Note You can check whether an instance has a namespace in the Basic Information section on the Instance Details page in the ApsaraMQ for RocketMQ console.
Create a group
- Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.
- In the top navigation bar, select a region. Example: China (Hangzhou). Then, click the ID of the instance that you want to manage.
- In the left-side navigation pane, click Groups.
- On the Groups page, select a protocol for your client SDK and click Create Group. ApsaraMQ for RocketMQ supports TCP and HTTP for client SDKs.
- In the panel that appears, configure the Group ID and Description parameters and click OK. On the Groups page, you can view the group that you created.
Delete a group
Warning After you delete a group, the consumer instances identified by the ID of the group stop receiving messages. The resources in the group are also deleted and cannot be restored. Exercise caution when you delete a group.
- On the Instances page, find the instance whose group you want to delete and click the instance name. In the left-side navigation pane, click Groups.
- On the Groups page, find the group that you want to delete, click More in the Actions column, and then select Delete from the drop-down list.
- In the dialog box that appears, click OK. On the Groups page, you can no longer view the group that you deleted.
Query the details of a group
- On the Instances page, find the instance that you want to manage. In the left-side navigation pane, click Groups.
- On the Groups page, find the group whose details you want to view, and click the group ID or click Details in the Actions column. The Group Details page appears. On the Group Details page, you can view the details of the group.
More operations
On the Groups page, you can perform other operations based on your business requirements.
- In the left-side navigation pane, click Groups.
- On the Groups page, find the group that you want to manage, click More in the Actions column, and then select one of the following options from the drop-down list:
- Quick Access: View the references that ApsaraMQ for RocketMQ provides for SDKs for multiple programming languages.
- Reset Consumer Offset: Reset consumer offsets to skip the accumulated or undesired messages and restart message consumption. You can also consume messages after a specific point in time regardless of whether the messages before this point in time are consumed. For more information, see Reset consumer offsets.
- Cloud Monitor: View the monitoring data of message production or consumption in the group.
- Message Consumption Chart: View the total number of messages to which consumers in the group subscribe. You can also view the message consumption rate that is measured by transactions per second (TPS).
References
You can call the following API operations to manage groups:
- OnsGroupCreate: creates a group.
- OnsGroupDelete: deletes a group.
- OnsGroupList: queries groups.
- OnsGroupSubDetail: queries the topics to which a group subscribes.
- OnsGroupConsumerUpdate: configures the read and write permissions on a group.