This topic describes how to create a message outflow task in the ApsaraMQ for RabbitMQ console to synchronize data from ApsaraMQ for RabbitMQ to Function Compute.
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.
Function Compute is activated. For more information, see Activate Function Compute.
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.
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 Function Compute and follow the on-screen instructions to configure other parameters. The following table describes the parameters.
Parameter
Description
Example
Service
The Function Compute service that you created.
test
Function
The Function Compute function that you created.
test
Version and Alias
The service version or alias.
Specified Version
Version
The function version. We recommend that you select the latest version.
LATEST
Invocation Mode
The invocation mode. Valid values: Synchronous and Asynchronous.
Asynchronous
Event
The method that you want to use to transform events. 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.