This topic describes how to create a custom event source of the Message Queue for RabbitMQ type in the EventBridge console.

Note

The regions that support custom event sources of the Message Queue for RabbitMQ type are subject to the regions where EventBridge is available.

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, enter a name in the Name field and a description in the Description field, select Message Queue for RabbitMQ from the Event Provider drop-down list, set the following parameters, and then click OK.
    • Region: Select the region where the created Message Queue for RabbitMQ instance resides.
    • Message Queue for RabbitMQ Instance: Select the created Message Queue for RabbitMQ instance.
    • Vhost: Select the created vhost.
    • Queue: Select the created queue.

Sample event

{
    "datacontenttype":"application/json;charset=utf-8",
    "aliyunaccountid":"143998900779****",
    "data":{
        "envelope":{
            "deliveryTag":98,
            "exchange":"",
            "redeliver":false,
            "routingKey":"housekeeping"
        },
        "body":{
            "Hello":"EventBridge"
        },
        "props":{
            "contentEncoding":"UTF-8",
            "messageId":"f7622d51-e198-41de-a072-77c1ead7****"
        }
    },
    "subject":"acs:amqp:cn-hangzhou:143998900779****:/instances/amqp-cn-zvp2av0m****/vhosts/eb-connect/queues/housekeeping",
    "aliyunoriginalaccountid":"143998900779****",
    "source":"housekeeping.rabbitmq",
    "type":"amqp:Queue:SendMessage",
    "aliyunpublishtime":"2021-08-12T06:56:50.783Z",
    "specversion":"1.0",
    "aliyuneventbusname":"Housekeeping-Connect",
    "id":"8b09e19b-8cbd-4c46-ab77-9cc39c44****",
    "time":"2021-08-12T06:56:40.709Z",
    "aliyunregionid":"cn-hangzhou"
}

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
body Map The content of the message.
Hello String EventBridge The user data.
props Map The properties of the message.
contentEncoding String utf-8 The format in which the content of the message is encoded.
messageId String f7622d51-e198-41de-a072-77c1ead7**** The ID of the message. The ID of each message is unique.
envelope Map The envelope information about the message.
deliveryTag Int 98 The tag of the message.
exchange String N/A The name of the exchange that sent the message.
redeliver Boolean false Indicates whether the message can be resent. Valid values:
  • true: The message can be resent.
  • false: The message cannot be resent.
routingKey String housekeeping The routing rule of the message.