This topic describes how to create an event stream whose event target is ApsaraMQ for RabbitMQ in the EventBridge console.
Prerequisites
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.
An ApsaraMQ for RabbitMQ instance is purchased and deployed. Make sure that the instance is in the Running state. For more information, see Step 1: Create resources.
Create an event stream
Log on to the EventBridge console. In the left-side navigation pane, click Event Streams.
In the top navigation bar, select a region and click Create Event Stream.
On the Create Event Stream 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, Filtering, and Transformation steps, configure the event source, event filtering method, and event transformation rule. Then, click Next Step. For information about event transformation configurations, see Use Function Compute to perform message cleansing.
In the Sink step, set the Service Type parameter to Message Queue for RabbitMQ and follow the on-screen instructions to configure other parameters. The following table describes the parameters.
Parameter
Description
Example
Instance ID
Select the ApsaraMQ for RabbitMQ instance that you created.
amqp-cn-zvp2pny6****
vhost
Select the vhost that you created.
test
Destination Type
Exchange: A producer sends a message to an exchange, and then the exchange routes the message to one or more queues.
Queue: Each message is sent to one or more queues.
Queue
Exchange
The exchange to which events are routed on the ApsaraMQ for RabbitMQ instance. This parameter is required only if you set the Destination Type parameter to Exchange.
exchange
Queue
The queue to which events are routed on the ApsaraMQ for RabbitMQ instance. This parameter is required only if you set the Destination Type parameter to Queue.
queue
Message Routing Key
EventBridge extracts data from an event by using JSONPath and routes the specified event content to the event target. This parameter is required only if you set the Destination Type parameter to Exchange.
Partial Event
$.data.keyMessage Body
EventBridge extracts data from an event by using JSONPath and routes the specified event content to the event target.
Partial Event
$.data.bodyMessageId
EventBridge extracts data from an event by using JSONPath and routes the specified event content to the event target.
Partial Event
$.data.props.messageIdCustom Property
EventBridge extracts data from an event by using JSONPath and routes the specified event content to the event target.
Partial Event
$.data.props
Task Property
Configure the retry policy and dead-letter queue for the event stream. For more information, see Retry policies and dead-letter queues.
Go back to the Event Streams page and find the event stream that you created. Then, click Enable in the Actions column.
Enabling an event stream requires 30 to 60 seconds to complete. You can view the progress in the Status column of the event stream on the Event Streams page.
Verify the result
Log on to the ApsaraMQ for RabbitMQ console. In the Resource Distribution section of the Overview page, select the region where your ApsaraMQ for RabbitMQ instance resides.
On the Instances page, click the name of the instance that you want to manage.
In the Basic Information section of the Instance Details page, click the Message Query tab.
On the Message Query tab, select Query by Queue and configure the Queue and Time Range parameters. Then, click Query.
