EventBridge event streams route messages from one ApsaraMQ for RocketMQ instance to another without an event bus. Use event streams to replicate messages across regions, synchronize data between environments, or consolidate messages from multiple instances.
How it works
An event stream connects a source RocketMQ instance to a destination RocketMQ instance through a real-time pipeline:
EventBridge consumes messages from a topic on the source instance.
(Optional) Filtering rules select which messages to forward.
EventBridge extracts the message body, decodes the Base64-encoded binary data, and delivers it to the destination instance.
The message arrives at the specified topic on the destination instance with the original body, key, tag, and custom properties preserved.
Create the event stream in the region of the destination instance. For example, to route messages from China (Beijing) to China (Hangzhou), create the event stream in China (Hangzhou).
Prerequisites
Before you begin, make sure that you have:
An activated EventBridge service with the required permissions granted to a Resource Access Management (RAM) user. For more information, see Activate EventBridge and grant permissions to a RAM user
At least two ApsaraMQ for RocketMQ instances in the Running state. For more information, see Create an instance
A dedicated consumer group on the source instance for the event stream. Do not reuse an existing consumer group because this may disrupt message delivery
Create the event stream
Log on to the EventBridge console.
In the top navigation bar, select the region of the destination RocketMQ instance.
In the left-side navigation pane, click Event Streams.
On the Event Streams page, click Create Event Stream.
Specify the Task Name and Description, then configure the source, filtering, and sink settings as described in the following sections.
Configure the source
In the Source step, set Data Provider to ApsaraMQ for RocketMQ and configure the following parameters, then click Next Step.
| Parameter | Description | Example |
|---|---|---|
| Region | Region of the source RocketMQ instance | China (Hangzhou) |
| Version | Version of the source RocketMQ instance | RocketMQ 4.x |
| Instance | Source instance that produces the messages to route | MQ_INST_115964845466\*\*\*\*_ByBehioo |
| Topic | Topic on the source instance that contains the messages | topic |
| Tag | Tag for filtering messages on the source instance | test |
| Group ID | Dedicated consumer group on the source instance. Use a separate group for the event stream to avoid disrupting existing consumers | GID_http_1 |
| Consumer Offset | Starting offset for consuming messages | Latest Offset |
| Data Format | Encoding format for binary data from the source. Set to Binary for message routing | Binary |
| Batch Push | Aggregates multiple events before delivery. A batch is sent when either the Messages count or Interval is reached, whichever comes first | Enable |
| Messages | Maximum number of messages per batch. Valid values: 1 to 10000 | 100 |
| Interval (Unit: Seconds) | Maximum wait time before a batch is sent. Valid values: 0 to 15. A value of 0 sends messages immediately | 3 |
Configure filtering
In the Filtering step, specify event filtering rules if needed, then click Next Step.
Specific content in the message value cannot be used to filter events based on the configurations in this example. For standard message routing, no filtering is required. The Transformation step is also not needed for this use case. Skip it and proceed to the sink configuration.
Configure the sink
In the Sink step, set Service Type to ApsaraMQ for RocketMQ and configure the following parameters, then click Save.
| Parameter | Description | Example |
|---|---|---|
| Version | Version of the destination RocketMQ instance | RocketMQ 4.x |
| Instance ID | ID of the destination RocketMQ instance | test |
| Topic | Topic on the destination instance to receive the routed messages | test |
| Message Body | JSONPath expression to extract and Base64-decode the message body from the event | Binary Extraction: $.data.body |
| Custom Property | Template-based extraction that maps source message attributes to the destination. Select Template and use the variables and template shown in the example to forward all message attributes | Variables: {"userProperties":"$.data.userProperties", "msgId":"$.data.systemProperties.UNIQ_KEY"} Template: {"EB_SYS_EMBED_OBJECT":"${userProperties}", "UNIQ_KEY":"${msgId}"} |
| Message Key | JSONPath expression to extract the message key from the event | Partial Event: $.data.systemProperties.KEYS |
| Message Tag | JSONPath expression to extract the message tag from the event | Partial Event: $.data.systemProperties.TAGS |
The Custom Property configuration above forwards all user-defined message attributes and the original message ID. This preserves traceability across instances.
Configure retry and dead-letter settings
Under Task Property, specify the retry policy and dead-letter queue for the event stream. The retry policy determines how EventBridge handles delivery failures. The dead-letter queue stores messages that cannot be delivered after all retries are exhausted, so you can investigate and reprocess them later.
For more information, see Retry policies and dead-letter queues.
Enable the event stream
Go back to the Event Streams page, find the event stream, and click Enable in the Actions column.
In the Note dialog, click OK.
The event stream takes 30 to 60 seconds to start. Monitor the Status column on the Event Streams page until the stream is running.
Verify the event stream
Send a test message from the source instance and confirm it arrives at the destination.
Send a test message
Log on to the ApsaraMQ for RocketMQ console.
In the top navigation bar, select the region of the source RocketMQ instance.
In the left-side navigation pane, click Instances.
Find the source instance, then click Details in the Actions column.

In the left-side navigation pane, click Topics.
Click the name of the source topic configured in the event stream.
In the upper-right corner of the Topic Details page, click Quick Start.
In the Start Message Production and Consumption panel, set Sending Method to Console, fill in the Body, Message Key, and Message Tag fields, then click OK. After the message is sent, the console displays The message is sent. along with the message ID. Note this ID for verification.

Check the destination
Go back to the Instances page.
Find the destination instance, then click Details in the Actions column.
In the left-side navigation pane, click Topics.
Click the name of the destination topic configured in the event stream.
On the Topic Details page, click the Message Query tab.
Set the Query Method and Time Range, then click Search.

Confirm that the message ID, tag, and key match those of the message sent from the source instance.