Message Queue for Apache RocketMQ (offset data)

更新时间:
复制 MD 格式

This topic describes how to add Message Queue for RocketMQ (offset data) as an event source to an event stream in the EventBridge console.

Prerequisites

Procedure

  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Streams.

  2. In the top navigation bar, select a region and click Create Event Stream.

  3. On the Create Event Stream panel, enter a Task Name and Description, configure the following parameters, and then click Save.

    • Task Creation

      1. In the Source step of the wizard, select Message Queue for RocketMQ (offset data) from the Data Provider drop-down list. Configure the following parameters and then click Next Step.

        Parameter

        Description

        Example

        Region

        Select the region of the source ApsaraMQ for RocketMQ instance.

        China (Hangzhou)

        Version

        Select the version of the RocketMQ instance. The following versions are supported:

        • RocketMQ 4.x

        • RocketMQ 5.x

        RocketMQ 5.x

        Instance

        Select the source ApsaraMQ for RocketMQ instance.

        rmq-cn-jte3w5i****

        Topic

        Select the source ApsaraMQ for RocketMQ topic.

        topic

        Messages

        The maximum number of messages per batch. EventBridge sends a request when the accumulated message count reaches this value. Valid values: 1 to 10,000.

        100

        Interval (Unit: Seconds)

        The maximum time (in seconds) to wait before sending a batch. If the batch size is not reached within this interval, the system sends the messages accumulated so far. Valid values: 0 to 15. A value of 0 means immediate delivery.

        3

      2. In the Filtering, Transformation, and Sink steps, configure event filtering and transformation rules and specify an event sink.

    • Task properties

      Configure the retry policy and dead-letter queue for the event stream.

  4. Return to the Event Streams page, find your event stream, and click Enable in the Actions column.

    After you enable the event stream, it starts within 30 to 60 seconds. You can view the progress in the Status column on the Event Streams page.

Event example

{
    "datacontenttype": "application/json;charset=utf-8",
    "aliyunaccountid": "1******6789",
    "data": {
        "systemProperties": {
            "BORN_TIMESTAMP": "1713756930836",
            "MSG_REGION": "cn-hangzhou",
            "UNIQ_KEY": "123F486466E118B4AAC26EA24F13****",
            "TAGS": "tagA"
        },
        "userProperties": {
            "demoPropertyKey": "demoPropertyValue"
        },
        "msgId": "123F486466E118B4AAC26EA24F13****",
        "topic": "test-topic",
        "body": {
            "number": 100,
            "name": "EventBridge"
        }
    },
    "subject": "acs:mq:cn-hangzhou:1******6789:rmq-cn-123456abc%test-topic",
    "aliyunoriginalaccountid": "1******6789",
    "source": "RocketMQSource",
    "type": "mq:Topic:SendMessage",
    "aliyunpublishtime": "2024-04-22T03:35:31.315Z",
    "specversion": "1.0",
    "aliyuneventbusname": "DemoBus",
    "id": "123F486466E118B4AAC26EA24F13****",
    "time": "2024-04-22T03:35:30.836Z",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.20.11.11"
}

For information about the parameters defined in the CloudEvents specification, see Event overview.

The parameters in the data field are described in the following table.

Parameter

Type

Example

Description

systemProperties

Map

--

The system properties.

BORN_TIMESTAMP

String

1713756930836

The timestamp when the message was produced.

MSG_REGION

String

cn-hangzhou

The region from which the message was sent.

UNIQ_KEY

String

AC14C305069E1B28CDFA3181CDA2****

The unique key of the message.

TAGS

String

tagA

The tags used for message filtering.

userProperties

Map

{"demoPropertyKey":"demoPropertyValue" }

The user-defined properties.

msgId

String

123F486466E118B4AAC26EA24F13****

The globally unique ID of the message.

topic

String

test-topic

The topic name.

body

String

{"number": 100, "name": "EventBridge"}

The message content.