This topic describes how to create a task in the ApsaraMQ for RabbitMQ console to export data from one ApsaraMQ for RabbitMQ instance to another ApsaraMQ for RabbitMQ instance.
Prerequisites
An ApsaraMQ for RabbitMQ instance is purchased and deployed. Make sure that the instance is in the Running state. For more information, see Creating resources.
EventBridge is activated and the required permissions are granted to a Resource Access Management (RAM) user. For more information, see Activate EventBridge and grant permissions.
Create an export task
-
Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, choose .
-
In the top navigation bar, select a region, such as China (Hangzhou). On the Tasks page, click Create Task.
-
On the Create Task page, configure the Task Name and Description parameters and follow the on-screen instructions to configure other parameters. Then, click Save. The following section describes the parameters:
-
Task creation
-
In the Source step, set Data Provider to Message Queue for RabbitMQ, configure the following parameters, and then click Next.
Parameter
Description
Example
Region
The region where the task is created. This parameter cannot be changed.
China (Hangzhou)
RabbitMQ instance
Select the source Message Queue for RabbitMQ instance.
amqp-cn-******lpc00a
vhost
Select the vhost of the source Message Queue for RabbitMQ instance.
test
Queue
Select the queue of the source Message Queue for RabbitMQ instance.
queue_test
Messages
The maximum number of messages in a single batch. A batch is sent when it reaches this size. Valid values: 1 to 10,000.
100
Interval (Unit: Seconds)
The maximum wait time in seconds before sending a batch. A batch is sent when this interval elapses, even if the batch size is not reached. Valid values: 0 to 15. A value of 0 means batches are sent immediately.
3
-
In the Filtering step, define a filter rule in the Pattern Content editor to filter events. For more information, see Event patterns.
-
In the Transformation step, you can perform complex data processing, such as splitting, mapping, enrichment, and dynamic routing. For more information, see Use Function Compute to clean message data.
-
In the Sink configuration wizard, set Service Type to ApsaraMQ for RabbitMQ and configure the following parameters.
Parameter
Description
Example
Instance ID
Select an existing ApsaraMQ for RabbitMQ instance.
amqp-cn-zvp2pny6****
vhost
Select an existing Vhost.
test
Destination Type
-
Exchange: A producer sends a message to an exchange. The exchange then routes the message to one or more queues.
-
Queue: Each message is sent to one or more queues.
Queue pattern
Exchange
If you set Destination Type to Exchange, select an exchange in ApsaraMQ for RabbitMQ.
exchange
Queue
If you set Destination Type to Queue, select a queue in ApsaraMQ for RabbitMQ to receive messages.
queue
Message Routing Key
EventBridge uses JSONPath to extract data from an event and route the specified event content to the event target. This parameter is required if you set Destination Type to Exchange.
Data extraction
$.data.keyMessage Body
EventBridge uses JSONPath to extract data from an event and route the specified event content to the event target.
Data extraction
$.data.bodyMessageId
EventBridge uses JSONPath to extract data from an event and route the specified event content to the event target.
Data extraction
$.data.props.messageIdEventBridge uses JSONPath to extract data from an event and route the specified event content to the event target.
Data extraction
$.data.props -
-
-
Task properties
Configure retry policies for failed deliveries and set up error handling. For more information, see Retry policies and dead-letter queues.
-
Other operations
On the Tasks page, find the task and choose an action in the Actions column.
-
View task details: Click Details. The Message Outflow Task Details page displays the source, sink, and resource configurations for the task.
-
Edit the task: Click Edit. In the Modify Message Outflow Task panel, you can change the resource and rule configurations.
-
Enable or pause the task: Click Enable or Disable. In the Note dialog box, click OK.
-
Delete the task: Click Delete. In the Note dialog box, click OK.