All Products
Search
Document Center

ApsaraMQ for RocketMQ:ExecuteMigrationOperation

Last Updated:Dec 19, 2025

Executes a specified operation on a migration task.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rocketmq:ExecuteMigrationOperation

update

*Instance

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Request syntax

POST /migrations/{migrationId}/stages/{stageType}/operations/{operationId}/execute HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

migrationId

integer

Yes

The migration ID.

44

instanceId

string

No

The instance ID.

rmq-cn-x0r37kel***

stageType

string

Yes

The migration stage type. The value is MIGRATE_MESSAGE.

Valid values:

  • MIGRATE_MESSAGE :

    Message migration

MIGRATE_MESSAGE

operationId

integer

Yes

The migration operation ID.

2729

body

object

No

The request body structure.

operationParam

object

No

The operation parameters.

paramData

any

No

The parameter information. The parameter is a JSON string. For more information, see the example.

The valid values for the `action` (operation) field are as follows:

  • MIGRATE_FORWARD (Fast forward migration)

  • MIGRATE_BACKWARD (Rewind migration)

The valid values for the `targetStage` (target stage) field are as follows:

  • MIGRATE_WAIT (Read from and write to the source cluster)

  • DOUBLE_READ (Write to the source cluster and perform redundant reads)

  • SWITCH_WRITE (Write to the destination cluster and perform redundant reads)

  • MIGRATE_FINISH (Read from and write to the destination cluster)

Note
  • For fast forward migration, you can only proceed one stage at a time in sequence.

  • For rollback migration, you can roll back to any previous stage.

迁移前进:{"action":"MIGRATE_FORWARD","targetStage":"MIGRATE_FINISH"} 迁移后退:{"action":"MIGRATE_BACKWARD","targetStage":"MIGRATE_WAIT"}

Response elements

Element

Type

Description

Example

object

Result

requestId

string

The request ID.

814BCD66-2D76-5080-AAD2-E50E5BDB0995

success

boolean

Indicates whether the request was successful.

true

data

object

The returned result.

operationId

integer

The migration operation ID.

110

migrationId

integer

The migration ID.

6

stageType

string

The migration stage type.

Valid values:

  • MIGRATE_MESSAGE :

    Migrate messages

MIGRATE_MESSAGE

operationType

string

The operation type. The value is MIGRATE_MESSAGE (Migrate messages).

MIGRATE_MESSAGE

operationStatus

string

The operation status:

  • INIT (Not started)

  • DOING (In progress)

  • DONE (Completed)

  • FAIL (Failed)

Valid values:

  • INIT :

    Not started

  • DONE :

    Completed

  • DOING :

    In progress

  • FAIL :

    Failed

DOING

operationKey

string

The primary key of the operation object.

normal-topic-1

businessStatus

string

The business status of the operation:

  • MIGRATE_WAIT (Read from and write to the source cluster)

  • DOUBLE_READ (Write to the source cluster and perform redundant reads)

  • SWITCH_WRITE (Write to the destination cluster and perform redundant reads)

  • MIGRATE_FINISH (Read from and write to the destination cluster)

  • ALREADY_MIGRATED (Migrated)

Valid values:

  • MIGRATE_CHECK :

    Read from and write to the source cluster

  • SWITCH_WRITE :

    Write to the destination cluster and perform redundant reads

  • MIGRATE_FINISH :

    Read from and write to the destination cluster

  • DOUBLE_READ :

    Write to the source cluster and perform redundant reads

  • ALREADY_MIGRATED :

    Migrated

MIGRATE_WAIT

operationParam

object

The operation parameters.

paramData

any

The parameter information.

{"action":"MIGRATE_FORWARD","targetStage":"MIGRATE_FINISH"}

operationResult

object

The operation result.

resultData

any

The operation result.

{ "checkStatus": "WAIT_CHECK", "sourceTopicStatus": "PERM_6", "targetTopicStatus": "PERM_4", "checkResult": {}, "migrateStage": "DOUBLE_READ" }

createTime

string

The creation time.

2022-08-01 20:05:50

updateTime

string

The modification time.

2022-08-01 20:05:50

code

string

The error code.

Topic.NotFound

message

string

The error message.

The topic already exists.

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Examples

Success response

JSON format

{
  "requestId": "814BCD66-2D76-5080-AAD2-E50E5BDB0995",
  "success": true,
  "data": {
    "operationId": 110,
    "migrationId": 6,
    "stageType": "MIGRATE_MESSAGE",
    "operationType": "MIGRATE_MESSAGE",
    "operationStatus": "DOING",
    "operationKey": "normal-topic-1",
    "businessStatus": "MIGRATE_WAIT",
    "operationParam": {
      "paramData": "{\"action\":\"MIGRATE_FORWARD\",\"targetStage\":\"MIGRATE_FINISH\"}"
    },
    "operationResult": {
      "resultData": "{\n    \"checkStatus\": \"WAIT_CHECK\",\n    \"sourceTopicStatus\": \"PERM_6\",\n    \"targetTopicStatus\": \"PERM_4\",\n    \"checkResult\": {},\n    \"migrateStage\": \"DOUBLE_READ\"\n}"
    },
    "createTime": "2022-08-01 20:05:50",
    "updateTime": "2022-08-01 20:05:50"
  },
  "code": "Topic.NotFound",
  "message": "The topic already exists.",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.