forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
9.6 KiB
9.6 KiB
Using an SMN Trigger
This section describes how to create an SMN trigger and publish a message to trigger a function.
For details about the SMN event source, see section "Supported Event Sources".
Prerequisites
- You have created an SMN topic, for example, smn-test. For details, see Creating a Topic.
- You have created a function. For details, see Creating a Function from Scratch.
Creating an SMN Trigger
- Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the function to be configured to go to the function details page.
- Choose Configuration > Triggers and click Create Trigger.
- Set the following parameters:
- Trigger Type: Select Simple Message Notification (SMN).
- Topic Name: Select a topic, for example, smn-test.
- Click OK.
Publishing a Message to Trigger the Function
On the SMN console, publish a message to the smn-test topic. For details, see Publishing a Text Message.
Table 1 describes the parameters required for publishing a message.
Viewing the Execution Result
- Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click a function to go to the function details page.
- Choose Monitoring > Logs to query function running logs.
Parent topic: Creating Triggers