SMN Event Source¶
Simple Message Notification (SMN) sends messages to email addresses, mobile phones, or HTTP/HTTPS URLs. If you create a function with an SMN trigger, messages published to a specified topic will be passed as a parameter to invoke the function. Then, the function processes the event, for example, publishing messages to other SMN topics or sending them to other cloud services.
For details, see Using an SMN Trigger.
SMN example event¶
{
"record": [
{
"event_version": "1.0",
"smn": {
"topic_urn": "topicUrn",
"timestamp": "2018-01-09T07:11:40Z",
"message_attributes": null,
"message": "this is smn message content",
"type": "notification",
"message_id": "a51671f77d4a479cacb09e2cd591a983",
"subject": "this is smn message subject"
},
"event_subscription_urn": "functionUrn",
"event_source": "smn"
}
],
"functionname": "test",
"requestId": "7c307f6a-cf68-4e65-8be0-4c77405a1b2c",
"timestamp": "Tue Jan 09 2018 15:11:40 GMT+0800 (CST)"
}
Parameter description¶
Parameter |
Type |
Description |
|---|---|---|
event_version |
String |
Event version |
topic_urn |
String |
ID of an SMN event |
timestamp |
String |
Time when an event occurs |
message_attributes |
Map |
Message attributes |
message |
String |
Message content |
type |
String |
Event type |
message_id |
String |
Message ID. The ID of each message is unique. |
subject |
String |
Subject of message |
event_subscription_urn |
String |
Subscription ID |
event_source |
String |
Event source: smn |