This topic describes how to create a custom event source of the Message Queue for Apache RocketMQ type in the EventBridge console.
Prerequisites
- Message Queue for Apache RocketMQ
- EventBridge
Procedure
Sample event
{
"id":"94ebc15f-f0db-4bbe-acce-56fb72fb****",
"source":"acs:mq",
"specversion":"1.0",
"type":"mq:Topic:SendMessage",
"datacontenttype":"application/json; charset=utf-8",
"subject":"acs:mq:cn-hangzhou:123456789098****:MQ_INST_123456789098****_BXhFHryi%TopicName",
"time":"2021-04-08T06:01:20.766Z",
"aliyunpublishtime":"2021-04-08T06:01:20.725Z",
"aliyuneventbusname":"BusName",
"data":{
"topic":"TopicName",
"systemProperties":{
"MIN_OFFSET":"0",
"TRACE_ON":"true",
"MAX_OFFSET":"8",
"MSG_REGION":"cn-hangzhou",
"KEYS":"systemProperties.KEYS",
"CONSUME_START_TIME":1628577790396,
"UNIQ_KEY":"AC14C305069E1B28CDFA3181CDA2****",
"TAGS":"systemProperties.TAGS",
"INSTANCE_ID":"MQ_INST_123456789098****_BXhFHryi"
},
"userProperties":{
},
"body":"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 |
---|---|---|---|
topic | String | TopicName | The name of the topic. |
systemProperties | Map | The system properties. | |
MIN_OFFSET | Int | 0 | The minimum offset. |
TRACE_ON | Boolean | true | Indicates whether a message trace exists. Valid values:
|
MAX_OFFSET | Int | 8 | The maximum offset. |
MSG_REGION | String | cn-hangzhou | The region from which the message was sent. |
KEYS | String | systemProperties.KEYS | The keys for filtering. |
CONSUME_START_TIME | Long | 1628577790396 | The start time of consumption. Unit: milliseconds. |
UNIQ_KEY | String | AC14C305069E1B28CDFA3181CDA2**** | The unique key of the message. |
TAGS | String | systemProperties.TAGS | The tags for filtering. |
INSTANCE_ID | String | MQ_INST_123456789098****_BXhFHryi | The ID of the instance. |
userProperties | Map | N/A | The user properties. |
body | String | TEST | The content of the message. |