触发器事件消息格式 CloudEvent格式如下: plaintext [ { "id": "eca534636baf4d568f86cbdb748208ed", "source": "ctyun.faas.trigger.rabbitmq", "specversion": "1.0", "type": "rabbitmq:queue:sendmessage", "datacontenttype": "application/json", "subject": ":mqfunchckzeddbxjrabbit::testforfaas", "time": "20250522T02:04:16Z", "data": { "headers": { "myheader": "headervalue" }, "properties": { "deliveryMode": 1, "priority": 0 }, "deliveryTag": 1, "redelivered": false, "exchange": "", "routingKey": "testforfaas", "body": "hello, rabbitmq" } } ] 参数 类型 示例值 描述 id string eca534636baf4d568f86cbdb748208ed 事件ID。标识事件的唯一值。 source string ctyun.faas.trigger.rabbitmq 事件源。RabbitMQ触发器固定为ctyun.faas.trigger.rabbitmq。 specversion string 1.0 CloudEvents协议版本。 type string rabbitmq:queue:sendmessage 事件类型。 datacontenttype string application/json 参数data的内容形式。 subject string mqfunchckzeddbxjrabbit::testforfaas 事件主体。 time string 20250522T02:04:16Z 消息被触发的时间。 data object RabbitMQ触发器独有数据格式,详细参见下文RawData描述。 RawData格式是CloudEvent格式的子集,只包含原始rabbitmq消息的信息,消息结构相当于CloudEvent的data字段,具体如下: plaintext [ { "headers": { "myheader": "100" }, "properties": { "deliveryMode": 1, "priority": 0, "type": "mytype" }, "deliveryTag": 1, "redelivered": false, "exchange": "", "routingKey": "testforfaas", "body": "hello, rabbitmq" } ] 参数 类型 示例 描述 headers map {"myheader": "100"} 消息的自定义header。 properites map { "deliveryMode": 1, "priority": 0, "type": "mytype" } 消息的自定义属性值。 deliveryTag int 1 消息的tag。 redelivered bool false 消息是否是被重新投递: false:表示这条消息是第一次投递给消费者。 true:表示这条消息是被重新投递的。 exchange string 消息的Exchange。 routingKey string testforfaas 消息的路由key。 body string hello, rabbitmq 消息的内容。