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
- Log on to the EventBridge console.
- In the left-side navigation pane, click Event Buses.
- In the top navigation bar, select a region.
On the Event Buses page, click the name of the event bus that you want to manage.
In the left-side navigation pane, click Event Sources.
On the page that appears, click Add Event Source.
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. |