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 Service/Function.
- Find the required function in the required service and click the name of the function.
- Click the Triggers tab. On the tab, click Create Trigger.
- In the Create Trigger dialog box, enter the related 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 Authorizationfrom 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.