Updated on 2023-07-17 GMT+08:00

Migrating RabbitMQ Services

Scenario

Migrate RabbitMQ services from a single-node or cluster instance not on Huawei Cloud (the source instance) to a RabbitMQ instance on Huawei Cloud (the destination instance).

Solution

Migrate production applications and then consumption applications. No data migration is involved.

Procedure

Migrate the production applications to the destination instance. New messages are no longer published to the source instance, and consumer applications consume messages from both the source and destination instances. After all messages in the source instance are consumed, migrate the consumption applications to the destination instance.

  • Messages may not be ordered consistently.
  • Ensure that the client and the destination instance can be connected.

Check whether all messages in the source instance have been consumed by using the RabbitMQ Management UI or by calling an API:

  • Using the RabbitMQ Management UI, as shown in Figure 1.

    On the Overview tab page, if the number of messages that can be consumed (Ready) and the number of messages that are not acknowledged (Unacked) are both 0, the consumption is complete.

    Figure 1 RabbitMQ Management UI
  • Using an API
    curl -s -u username:password -XGET http://ip:port/api/overview

    Parameter description:

    • username: account used to log in to the RabbitMQ Management UI for the source instance
    • password: password used to log in to the RabbitMQ Management UI for the source instance
    • ip: IP address used to log in to the RabbitMQ Management UI for the source instance
    • port: port used to log in to the RabbitMQ Management UI for the source instance

    When the values of messages_ready and messages_unacknowledged in the command output are both 0, the consumption is complete.

    Figure 2 Command output