This topic describes how to smoothly migrate the messaging service from an open source RocketMQ implementation to Alibaba Cloud Message Queue for Apache RocketMQ.

Background information

After metadata migration, you need to manually modify the access information of the producer clusters and consumer clusters so that the clusters switch from the open source RocketMQ implementation to the Alibaba Cloud Message Queue for Apache RocketMQ instance. In this way, messages are sent and received by the Message Queue for Apache RocketMQ instance after the migration.

Only message production and consumption links are migrated, but not message data on the open source RocketMQ implementation.

This topic describes how to migrate the messaging service with dual-read, dual-write, and phased release. During the migration, the producer clusters and the consumer clusters on both the open source RocketMQ implementation and Message Queue for Apache RocketMQ are not stopped. As a result, services can be smoothly migrated without data backlog. For more information about the specific solution and procedure, see the section Migrate the messaging service.

Prerequisites

The metadata of the open source RocketMQ has been migrated to the Message Queue for Apache RocketMQ instance. For more information, see Step 3: Migrate the metadata.

Migrate the messaging service

The procedure and detailed steps of migrating the messaging service are as follows:
Note In the following steps, modifying the access information of the nodes in the consumer clusters or producer clusters refers to changing the access information of the producer or consumer clients to the information of the destination Message Queue for Apache RocketMQ instance. The information includes the Endpoints of the Message Queue for Apache RocketMQ instance, and the AccessKey and AccessKey Secret of the account to which the instance belongs.
  1. Modify the access information of some nodes in the consumer clusters, so that these consumers access the Message Queue for Apache RocketMQ in the cloud.
    These consumers consume messages in the Message Queue for Apache RocketMQ clusters. Other consumers continue to consume messages in the open source RocketMQ clusters.
  2. Modify the access information of some nodes in the producer clusters, so that these producers access the Message Queue for Apache RocketMQ in the cloud.
    These producers send messages to the Message Queue for Apache RocketMQ clusters. Other producers continue to send messages to the open source RocketMQ clusters.
  3. Connect all the remaining producers to the Message Queue for Apache RocketMQ.
    All messages are sent to the Message Queue for Apache RocketMQ clusters in the cloud.
  4. Connect all remaining consumers to the Message Queue for Apache RocketMQ.
    Notice Before switching all the remaining consumers to the cloud, make sure that all messages in the open source RocketMQ implementation have been consumed. You can check the number of messages accumulated in the open source RocketMQ implementation to determine whether all messages are consumed.
    All producers and consumers are migrated to the Message Queue for Apache RocketMQ clusters, and all messages are sent and received in the Message Queue for Apache RocketMQ clusters.