This topic describes how to create an MNS topic trigger in the Function Compute console.
Create a trigger
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Services and Functions.
- In the Services pane, click the service that you require. On the Functions tab, click the name of the function that you require.
- Click the Triggers tab. Then, click Create Trigger.
- In the Create Trigger panel, enter the relevant information. Then, click OK.
Parameter Action Service Type Select MNS topic triggers. Trigger Name Enter the name of a custom trigger. Version/Alias Enter the version of the trigger. Default value: LATEST. For more information, see Introduction. In the MNS Topic dialog box Select MNS Topic Region.
Please use same region for both MNS Topic and Function Compute, different regions will increase the network delay and the risk of being blocked.
Topic Select the created Topic from the drop-down list. Filter Label Please input filter label.
The function is triggered only when MNS Topic receives a message that contains the filter tag string set here.
Retry Policy Select Retry Policy. Values:
- Backoff Retry
- Index Attenuation
For more information about how to select a Retry Policy, see NotifyStrategy.
Event Format Select the Event format. Values:
- Select Quick Authorization from the drop-down list.
- Click Authorize.
- Click Comfirm Authorization Policy.
The trigger role is AliyunMNSNotificationRole.You can view the created trigger in the trigger list.