All Products
Search
Document Center

EventBridge:Create a custom event source of the SMQ type

Last Updated:Mar 11, 2026

Simple Message Queue (formerly MNS) (SMQ) queues can serve as event sources for EventBridge. This topic describes how to create an SMQ-type custom event source in the EventBridge console.

Prerequisites

Before you begin, make sure that you have:

SMQ

EventBridge

Add an SMQ event source

  1. Log on to the EventBridge console.

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

  3. In the top navigation bar, select a region.

  4. On the Event Buses page, click the name of the event bus that you want to manage.

  5. In the left-side navigation pane, click Event Sources.

  6. Click Add Event Source.

  7. In the Add Custom Event Source panel, configure the following parameters:

    ParameterDescription
    NameEnter a name for the event source.
    DescriptionEnter a description for the event source.
    Event ProviderSelect SMQ from the drop-down list.
    Queue NameSelect the SMQ queue to use as the event source.
  8. Click OK.

Sample event

When a message is sent to the SMQ queue, EventBridge generates a CloudEvent with the following structure:

{
    "id": "bffb9722-9c48-407b-9895-b038f78f****",
    "source": "acs:mns",
    "specversion": "1.0",
    "type": "mns:Queue:SendMessage",
    "datacontenttype": "application/json; charset=utf-8",
    "subject": "acs:mns:cn-hangzhou:123456789098****:queues/zeus",
    "time": "2021-04-08T06:28:17.093Z",
    "aliyunpublishtime": "2021-04-08T06:30:31.367Z",
    "aliyuneventbusname": "mybus",
    "data": {
        "requestId": "606EA3074344430D4C81****",
        "messageId": "C6DB60D1574661357FA227277445****",
        "messageBody": "TEST"
    }
}

CloudEvents envelope fields

The top-level fields follow the CloudEvents specification:

FieldTypeDescription
idStringUnique event identifier.
sourceStringEvent source identifier. For SMQ events, the value is acs:mns.
specversionStringCloudEvents specification version. The current value is 1.0.
typeStringEvent type. For queue messages, the value is mns:Queue:SendMessage.
datacontenttypeStringMedia type of the data field.
subjectStringResource path in the format acs:mns:<region-id>:<account-id>:queues/<queue-name>.
timeStringTimestamp when the event occurred (ISO 8601).
aliyunpublishtimeStringTimestamp when EventBridge published the event (ISO 8601).
aliyuneventbusnameStringName of the event bus that received the event.

Data field parameters

The data object contains the original message details:

ParameterTypeExampleDescription
requestIdString606EA3074344430D4C81****Unique request ID for the send operation.
messageIdStringC6DB60D1574661357FA227277445****Unique message ID assigned by the queue.
messageBodyStringTESTBody of the message sent to the queue.