This topic describes how to create a custom event source of the MNS type in the EventBridge console.

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 target event bus.
  5. In the left-side navigation pane, click Event Sources.
  6. On the Event Sources page, click Add Event Source.
  7. In the Add Custom Event Source panel, set the Name and Description parameters, select Message Service (MNS) 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 the parameters in the data block.

Parameter Type Example Description
requestId String 606EA3074344430D4C81**** The ID of the request. The ID of each request is unique.
messageId String C6DB60D1574661357FA227277445**** The ID of the message. The ID of each message is unique.
messageBody String TEST The content of the message.