消息通知服务 SMN-订阅筛选策略使用样例:添加订阅

时间:2024-12-02 11:46:48

添加订阅

在已创建的主题下添加以下两种订阅。添加订阅详细操作步骤请参见订阅主题

  • 用户在主题下添加订阅终端A,并且希望在每周周日和周三的早上或下午将 消息通知 给A。则用户可以在创建订阅A时配置如下订阅筛选策略:
    {
        "filter_polices": [
            {
                "name": "week",
                "string_equals": [
                    "sunday",
                    "wednesday"
                ]
            },
            {
                "name": "time",
                "string_equals": [
                    "morning",
                    "afternoon"
                ]
            }
        ]
    }
  • 用户在主题下添加订阅终端B,并且希望在每周周一、周二和周三的晚上或深夜将消息通知给B。则用户在创建订阅B时配置如下订阅筛选策略:
    {
        "filter_polices": [
            {
                "name": "week",
                "string_equals": [
                    "monday",
                    "tuesday",
                    "wednesday"
                ]
            },
            {
                "name": "time",
                "string_equals": [
                    "night",
                    "midnight"
                ]
            }
        ]
    }
support.huaweicloud.com/usermanual-smn/smn_ug_a9005.html