All Products
Search
Document Center

EventBridge:Create a custom event source of the SMQ type

Last Updated:Oct 22, 2024

This topic describes how to create a custom event source of the Simple Message Queue (formerly MNS) (SMQ) type in the EventBridge console.

Before you start

Procedure

  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. On the page that appears, click Add Event Source.

  7. In the Add Custom Event Source panel, set the Name and Description parameters, select SMQ from the Event Provider drop-down list, select a created queue from the Queue Name drop-down list, and then click OK.

Sample event

{
    "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"
    }
}

For more information about the parameters defined in the CloudEvents specification, see Overview.

The following table describes parameters in the data field.

Parameter

Required

Example

Description

requestId

String

606EA3074344430D4C81****

The request ID. The ID of each request is unique.

messageId

String

C6DB60D1574661357FA227277445****

The message ID. The ID of each message is unique.

messageBody

String

TEST

The message body.