You can create multiple consumer groups when you use the change tracking feature. Consumers in different consumer groups can track data changes from the same data source. This helps you reduce the cost of tracking data changes.
Prerequisites
A change tracking instance is created and its status is Normal. For more information, see Overview of change tracking scenarios.
Usage notes
If the size of a single row of data that you track exceeds 16 MB, an out of memory (OOM) error may occur on the change tracking client.
You can create a maximum of 20 consumer groups in a change tracking instance to achieve repeated data consumption.
You can create only a single consumer in each consumer group.
- DTS reads incremental data by using the DStore module or a client. If you switch the module or client, data duplication may occur.
Procedure
Use one of the following methods to go to the Change Tracking Tasks page and select the region in which the change tracking instance resides.
DTS console
Log on to the DTS console.
In the left-side navigation pane, click Change Tracking.
In the upper-left corner of the page, select the region in which the change tracking instance resides.
DMS console
NoteThe actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode and Customize the layout and style of the DMS console.
Log on to the DMS console.
In the top navigation bar, move the pointer over
.From the drop-down list to the right of Change Tracking Tasks, select the region in which the change tracking instance resides.
Find the change tracking instance for which you want to create consumer groups and click the instance ID.
In the left-side navigation pane, click Consume Data.
On the Consume Data page, click Add Consumer Group in the upper-left corner.
In the Add Consumer Group dialog box, set parameters for the consumer group.
Parameter
Description
Consumer Group Name
Enter a new name for the consumer group. We recommend that you use a descriptive name that makes it easy to identify the consumer group.
Account
Enter the username of the consumer group.
The username can contain uppercase letters, lowercase letters, digits, and underscores (_).
The username must be 1 to 16 characters in length.
Password
Enter the password that corresponds to the username of the consumer group.
The password must contain at least two of the following character types: uppercase letters, lowercase letters, digits, and special characters.
The password must be 8 to 32 characters in length.
Confirm Password
Enter the password again.
Click OK.
What to do next
After you create consumer groups, choose one of the following methods based on the source database type and client type to consume the tracked data:
Consumption mode | Applicable database type | Description |
Use the SDK demo to consume the data tracked from a PolarDB-X 1.0 instance | PolarDB-X 1.0, DMS LogicDB | This mode is suitable for the change tracking tasks that run the PolarDB-X 1.0 or DMS LogicDB database. Note The change tracking tasks that run the PolarDB-X 1.0 or DMS LogicDB database supports only the consumption mode. |
MySQL, PolarDB for MySQL, PostgreSQL, Oracle, PolarDB (Compatible with Oracle), PolarDB for PostgreSQL, PolarDB-X 2.0 | This mode is suitable for most scenarios. Note We recommend that you use this consumption mode for the change tracking tasks that runs applicable databases. | |
This mode is suitable for the scenario that consumes tracked data by using Apache Flink. Apache Flink is a framework and distributed processing engine. | ||
This mode is suitable for the scenario that consumes tracked data by using a Kafka client and can develop source code. |