All Products
Search
Document Center

ApsaraMQ for RocketMQ:Export and import group data

Last Updated:Feb 21, 2024

ApsaraMQ for RocketMQ allows you to export the group data of an instance and then import the data to another ApsaraMQ for RocketMQ instance. When you change or clone an instance, you can use the group data export and import feature to quickly create groups that have the same basic information as the groups on the original instance.

Background information

You can use the group data export and import feature in the following scenarios:

  • Change an instance

    If the ApsaraMQ for RocketMQ instance that you use cannot meet your business requirements, you can purchase a new instance and use this feature to export the group data of the original instance and then import the data to the new instance. This way, the groups that you use on the original instance are automatically created on the new instance.

  • Clone an instance

    You can use this feature when you deploy different ApsaraMQ for RocketMQ instances and want your business to access the same groups in development, test, and production environments. In this case, you can create the related groups on one of the deployed instances, use the group data export and import feature to export the group data, and then import the data to another instance to quickly create the same groups on the existing instance.

Usage notes

  • The group metadata of ApsaraMQ for RocketMQ 4.x instances is different from that of ApsaraMQ for RocketMQ 5.x instances. When you export and import group data, take note of the following items:

    • You can directly import the group data of a 5.x instance to a 4.x instance. After you import the group data, only specific fields in the imported file take effect. For more information, see Step 5 of the "Import group data" section of the Import and export group data topic.

    • You cannot directly import the group data of a 4.x instance to a 5.x instance. Before you import the data, you must modify the parameters in the group data file to be imported based on the description in Step 5 of the "Import group data" section of this topic.

  • When you export and import group data, only basic information about the groups are exported and imported, such as the IDs, consumption policies, and descriptions of the groups. Subscriptions and message data are not changed or migrated.

  • When you import group data, the values of the parameters in the file that you want to import must meet the requirements that are specified in Step 5 of the "Import group data" section of this topic.

Export group data

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Groups.

  4. In the upper-right corner of the Groups page, click the 导出 icon.

    The system exports the group data of the instance and saves the data to an .xlsx file.

Import group data

You can directly import the exported group data to the destination instance. You can also update the exported group data based on your business requirements before you import the data to the destination instance.

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Groups.

  4. In the upper-right corner of the Groups page, click the 导入 icon.

  5. Select the group data file that you saved on your on-premises machine and click Open.

    The following table describes the requirements on the parameter values in the group data file that you want to import.

    Parameter

    Description

    Valid value

    ConsumerGroupId

    The group ID.

    • A group ID can contain letters, digits, underscores (_), and hyphens (-).

    • A group ID must be 1 to 60 characters in length.

    A group ID cannot contain characters that are reserved for the system or special prefixes. For more information, see Limits on parameters.

    DeliveryOrderType

    The order in which ApsaraMQ for RocketMQ delivers messages to consumer clients.

    Valid values:

    • Concurrently: concurrent delivery

    • Orderly: ordered delivery

    For more information, see Ordered messages.

    ConsumeRetryPolicy

    The retry policy that is used when a consumer fails to consume a message.

    Valid values:

    • FixedRetryPolicy: fixed-interval retry

    • DefaultRetryPolicy: exponential backoff retry

    For more information, see Message retry.

    MaxRetryTimes

    The maximum number of retries.

    Set this parameter to a value that is less than or equal to 1000.

    DeadLetterTargetTopic

    The dead-letter topic.

    • The topics from which dead-letter messages are sent cannot be used as dead-letter topics.

    • If you do not want to use the dead-letter message feature, leave this parameter empty.

    For more information, see Dead-letter messages.

    Remark

    The group description.

    The group description must be 1 to 60 characters in length.

    Example:

    ConsumerGroupId

    DeliveryOrderType

    ConsumeRetryPolicy

    MaxRetryTimes

    DeadLetterTargetTopic

    Remark

    testgroup1

    Orderly

    FixedRetryPolicy

    16

    Used to subscribe to billing messages.

    testgroup2

    Concurrently

    DefaultRetryPolicy

    16

    targettopic1

    Used to subscribe to logistics messages.

  6. In the Import Resources panel, select the group whose data you want to import and click Confirm and Import in the Actions column.

    You can also select multiple groups and click Batch Import.

    After you import the group data, the values in the Execution Results column of the group list change to Imported.

  7. In the lower-left corner of the Import Resources panel, click OK to complete the import operation.

    After the group data is imported, the groups whose data is imported appear in the group list.

References