All Products
Search
Document Center

EventBridge:Route events to ApsaraMQ for RocketMQ (Offset Resetting)

Last Updated:Mar 11, 2026

This topic describes how to use EventBridge to route event streams to ApsaraMQ for RocketMQ (Offset Reset) in real time to implement message distribution and consumption management in an event-driven architecture.

Prerequisites

Before you begin, make sure you have:

Create an event stream

Step 1: Start the event stream wizard

  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 and click Create Event Stream.

  4. In the Create Event Stream panel, enter a Task Name and Description.

Step 2: Configure the source, filtering, and transformation

In the Source, Filtering, and Transformation steps, specify the event source, event filtering rule, and event transformation rule. Then, click Next Step.

For details on event transformation, see Use Function Compute to perform message cleansing.

Step 3: Configure the sink

In the Sink step, select ApsaraMQ for RocketMQ (Offset Reset) from the Service Type drop-down list and configure the following parameters.

ParameterDescriptionExample
Instance TypeThe version of the ApsaraMQ for RocketMQ instance. Valid values: RocketMQ 4.x, RocketMQ 5.x.RocketMQ 5.x
InstanceIdThe ApsaraMQ for RocketMQ instance to which you want to route messages.rmq-cn-77845\*\*\*\*
TopicThe topic on the ApsaraMQ for RocketMQ instance to which you want to route messages. See Value modes below.Partial Event: $.data
GroupThe group used to manage offsets on the ApsaraMQ for RocketMQ instance. See Value modes below.Partial Event: $.data
ConsumeTimestampThe timestamp that specifies when messages are consumed. See Value modes below.Partial Event: $.data

Value modes for Topic, Group, and ConsumeTimestamp

The Topic, Group, and ConsumeTimestamp parameters each support three value modes:

Value modeBehavior
Partial EventExtract the value from an event field using a JSONPath expression, such as $.data.
Fixed ValueEnter a static value. All events use this value.
TemplateDefine custom content in the Variables and Template code editors to dynamically generate a value.
Note: For the ConsumeTimestamp parameter, the Template mode uses the Variable and Template code editors.

Step 4: Configure retry and dead-letter queue settings

Specify the retry policy and dead-letter queue for the event stream. For more information, see Retry policies and dead-letter queues.

Step 5: Save the event stream

Click Save to create the event stream.

Verify the result

After the event stream starts processing events, verify that offset resets are applied correctly on the ApsaraMQ for RocketMQ instance:

  1. Log on to the ApsaraMQ for RocketMQ console.

  2. In the top navigation bar, select the region where the instance resides.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, find the instance and click Details in the Actions column.

  5. In the left-side navigation pane, click Topics, then click the topic name.

  6. On the Topic Details page, click the Message Query tab.

  7. Set the Query Method and Time Range parameters, then click Query.