All Products
Search
Document Center

EventBridge:Route events to ApsaraMQ for RabbitMQ

Last Updated:Mar 11, 2026

EventBridge event streams continuously capture events from a source, apply optional filtering and transformation, and deliver results to a target. This topic walks you through creating an event stream that routes events to an ApsaraMQ for RabbitMQ instance.

Events are delivered to either a queue or an exchange on your RabbitMQ instance. EventBridge uses JSONPath expressions to extract specific fields from each event and map them to the RabbitMQ message body, routing key, MessageId, and custom properties.

Prerequisites

Before you begin, make sure that you have:

Create an event stream

  1. Log on to the EventBridge console.

  2. In the left-side navigation pane, click Event Streams.

  3. In the top navigation bar, select a region, then click Create Event Stream.

  4. Enter a Task Name and Description for the event stream.

  5. Configure the event source, filtering rules, and transformation logic:

    1. In the Source, Filtering, and Transformation steps, specify the event source, define filtering conditions, and set up any transformation rules. Then click Next Step. To transform event data with Function Compute, see Use Function Compute to perform message cleansing.

  6. Configure ApsaraMQ for RabbitMQ as the event target:

    1. In the Sink step, set Service Type to Message Queue for RabbitMQ.

    2. Configure the sink parameters described in the following table.

    3. Click Save.

Sink parameters

ParameterDescriptionExample
Instance IDThe ApsaraMQ for RabbitMQ instance to receive events.amqp-cn-zvp2pny6****
vhostThe virtual host on the selected instance.test
Destination TypeHow events are delivered. Exchange: routes messages through an exchange, which distributes them to one or more bound queues based on routing rules. Queue: sends messages directly to a specific queue.Queue
ExchangeThe exchange to route events to. Required only when Destination Type is set to Exchange.exchange
QueueThe queue to route events to. Required only when Destination Type is set to Queue.queue
Message Routing KeyA JSONPath expression that extracts the routing key from the event. Required only when Destination Type is set to Exchange.$.data.key
Message BodyA JSONPath expression that extracts the message payload from the event.$.data.body
MessageIdA JSONPath expression that extracts the message identifier from the event.$.data.props.messageId
Custom PropertyA JSONPath expression that extracts custom AMQP message properties from the event.$.data.props
All JSONPath parameters use Partial Event extraction -- EventBridge evaluates the expression against the incoming event and sends only the matching content to RabbitMQ.

Retry policy and dead-letter queue

In the Task Property section, configure the retry policy and dead-letter queue for the event stream. These settings control how EventBridge handles delivery failures.

For details, see Retry policies and dead-letter queues.

Enable the event stream

A newly created event stream is inactive by default. To start routing events:

  1. Go back to the Event Streams page.

  2. Find the event stream and click Enable in the Actions column.

Activation takes 30 to 60 seconds. Track the progress in the Status column.

Verify event delivery

Confirm that messages are arriving in your RabbitMQ instance:

  1. Log on to the ApsaraMQ for RabbitMQ console.

  2. In the Resource Distribution section of the Overview page, select the region where your instance resides.

  3. On the Instances page, click the name of the target instance.

  4. In the Basic Information section of the Instance Details page, click the Message Query tab.

  5. Select Query by Queue, specify the target queue and a Time Range, then click Query. Messages routed from EventBridge appear in the query results.

Query RabbitMQ messages