This topic describes how to create a message outflow task in the ApsaraMQ for RabbitMQ console to export data from ApsaraMQ for RabbitMQ to Simple Message Queue (formerly MNS).
Prerequisites
An ApsaraMQ for RabbitMQ instance is purchased and deployed. Make sure that the instance is in the Running state. For more information, see Step 2: Create resources.
An SMQ queue is created. For more information, see Activate SMQ and authorize RAM users to access SMQ.
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 to a RAM user.
Supported regions
When you create a message outflow task, you can use Simple Message Queue (formerly MNS) as the destination in the following regions: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), China (Chengdu), China (Hong Kong), US (Silicon Valley), US (Virginia), Germany (Frankfurt), Singapore, Japan (Tokyo), Malaysia (Kuala Lumpur), and Indonesia (Jakarta).
Create a message outflow 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 the Data Provider parameter to ApsaraMQ for RabbitMQ and follow the on-screen instructions to configure other parameters. Then, click Next Step. The following table describes the parameters.
Parameter
Description
Example
Region
The region that you selected in Step 2 of this section is used. You cannot change the value of this parameter.
China (Hangzhou)
ApsaraMQ for RabbitMQ Instance
The ApsaraMQ for RabbitMQ instance in which the messages that you want to route are produced.
amqp-cn-******lpc00a
vhost
The vhost of the ApsaraMQ for RabbitMQ instance in which the messages that you want to route are produced.
test
Queue
The queue on the ApsaraMQ for RabbitMQ instance in which the messages that you want to route are produced.
queue_test
Messages
The maximum number of messages that can be sent in each function invocation. Requests are sent only when the number of messages in the backlog reaches the specified value. Valid values: 1 to 10000.
100
Interval (Unit: Seconds)
The time interval at which the function is invoked. The system sends the aggregated messages to Function Compute at the specified time interval. Valid values: 0 to 15. Unit: seconds. The value 0 specifies that messages are sent immediately after aggregation.
3
In the Filtering step, define a data pattern to filter data in the Pattern Content code editor. For more information, see Event patterns.
In the Transformation step, specify a data cleansing method to implement data processing capabilities such as splitting, mapping, enrichment, and dynamic routing. For more information, see Use Function Compute to perform message cleansing.
In the Sink step, set the Service Type parameter to Message Service and follow the on-screen instructions to configure other parameters. The following table describes the parameters.
Parameter
Description
Example
Queue Name
The Simple Message Queue (formerly MNS) queue to which you want to route messages.
test
Enable Base64 Encoding
Yes: enables Base64 encoding. After you enable Base64 encoding, your data is encoded in the Base64 format before the data is sent to the destination Simple Message Queue (formerly MNS) queue.
No: disables Base64 encoding.
Yes
Message Body
The event transformation method. For more information, see Event transformation.
Complete Data
Task Property
Configure the retry policy that you want to use when events fail to be pushed and the method that you want to use to handle faults. For more information, see Retry policies and dead-letter queues.
Other operations
On the Tasks page, find the task that you created and perform other operations in the Actions column.
View the details of the task: Click Details in the Actions column. In the Message Outflow Task Details panel, view the source configurations, destination configurations, and resources of the task.
Modify the configurations of the task: Click Edit in the Actions column. In the Modify Message Outflow Task panel, modify the configurations of resources and rules.
Enable or disable the task: Click Enable or Pause in the Actions column. In the Note message, click OK.
Delete the task: Click Delete in the Actions column. In the Note message, click OK.