- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Cloud Eye Monitoring
- Logs
- Permissions Management
- Quotas
- Appendix
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
- APIs
- Examples
- Permissions Policies and Supported Actions
- Public Parameters
- Out-of-Date APIs
- Appendix
- SDK Reference
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- How Is SMN Billed?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- What Are the Limitations on SMS Messages?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- Does SMN Always Use the Same Phone Number or Sender Name to Send SMS Messages?
- How Do I Obtain My Account ID?
- How Does a DingTalk, Internal DingTalk, Lark, or WeCom Chatbot Obtain Subscription Endpoints?
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference
-
User Guide (Paris Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- What Are the Limitations on SMS Messages?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Paris Region)
-
User Guide (Kuala Lumpur Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Kuala Lumpur Region)
-
User Guide (Ankara Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Ankara Region)
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Using a Subscription Filtering Policy
Scenario
This section describes how to configure a subscription filtering policy when adding a subscription to specify the scope of message publishing. The default filtering policy applies to message attributes. If you have set a filtering policy and message attributes when publishing a message, the system determines whether to push the message to the subscriber based on the filtering policy.
Prerequisites
A topic has been created. For details, see Creating a Topic.
Adding a Subscription
You can add the following subscriptions to the created topic by referring to Adding a Subscription to a Topic.
- If you add a subscription endpoint A to the topic and want to receive notifications every Sunday and Wednesday morning or afternoon, you can configure the following subscription filtering policy when creating subscription A:
{ "filter_polices": [ { "name": "week", "string_equals": [ "sunday", "wednesday" ] }, { "name": "time", "string_equals": [ "morning", "afternoon" ] } ] }
- If you add a subscription endpoint B to the topic and want to receive notifications at night or late night on Monday, Tuesday, and Wednesday, you can configure the following subscription filtering policy when creating the subscription:
{ "filter_polices": [ { "name": "week", "string_equals": [ "monday", "tuesday", "wednesday" ] }, { "name": "time", "string_equals": [ "night", "midnight" ] } ] }
Publishing a Message
When you publish messages to a topic, different results will be obtained in different scenarios.
For details about how to publish a message, see Introduction.
- Scenario 1
The message attribute fields are as follows:
{ "name": "week", "type": "STRING", "value": [ "sunday" ] }
Sending result: The message will only be sent to subscription A because only week is specified, and time is not specified.
- Scenario 2:
The message attribute fields are as follows:
[ { "name": "week", "type": "STRING", "value": [ "sunday" ] }, { "name": "time", "type": "STRING", "value": [ "night" ] } ]
Sending result: Neither subscription A nor subscription B will receive the message because this message is intended only for subscribers who receive it on Sunday night.
- Scenario 3:
The message attribute fields are as follows:
[ { "name": "week", "type": "STRING", "value": [ "monday" ] }, { "name": "time", "type": "STRING", "value": [ "night" ] } ]
Sending result: This message is only sent to subscription B because this message is intended for subscribers who receive it on Monday night.
- Scenario 4
The message attribute fields are as follows:
[ { "name": "week", "type": "STRING", "value": [ "sunday" ] }, { "name": "time", "type": "STRING", "value": [ "morning" ] } ]
Sending result: This message is only sent to subscription A because this message is intended for subscribers who receive it on Sunday morning.
- Scenario 5
The message attribute fields are as follows:
[ { "name": "week", "type": "STRING_ARRAY", "value": [ "sunday", "monday" ] }, { "name": "time", "type": "STRING_ARRAY", "value": [ "morning", "night" ] } ]
Sending result: Both subscription A and subscription B can receive this message because this message is intended for subscribers who receive it in the morning or night on Sunday or Monday.
- Scenario 6
No subscription filtering policy is configured.
Sending result: Subscriptions without subscription filtering policies will not receive messages with any attributes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot