This topic describes how to create an event stream whose event provider is MNS in the EventBridge console.

Prerequisites

Procedure

  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Streaming.
  2. In the top navigation bar, select a region and click Create EventStreaming.
  3. In the Create EventStreaming panel, complete the wizard based on the following instructions and click Create.
    1. In the Basic Information step, set the EventStreaming Name and Description parameters and click Next Step.
    2. In the Event Source step, set the Event Provider parameter to Message Service (MNS), select the MNS queue that you create from the Queue Name drop-down list, select Enable Base64 Decoding, and then click Next Step.
    3. In the Rule and Event Target steps, configure an event rule and an event target.
    4. Go back to the Event Streaming page. On the Event Streaming page, find the event stream that you create and click Enable in the Actions column.
      It takes 30 to 60 seconds to enable the event stream. You can view the progress in the Status column on the Event Streaming page.

Sample event

{
    "specversion":"1.0",
    "id":"bffb9722-9c48-407b-9895-b038f78f****",
    "source":"acs:mns",
    "type":"mns:Queue:SendMessage",
    "subject":"acs:mns:cn-hangzhou:123456789098****:queues/zeus",
    "datacontenttype":"application/json; charset=utf-8",
    "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 nested under data.

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.