简体   繁体   English

AWS SNS主题数限制

[英]AWS SNS number of topics limit

There will be number of users. 将会有许多用户。 Each users may have number of areas. 每个用户可能有多个区域。 I want to send email alerts of 3 categories for each area. 我想为每个区域发送3个类别的电子邮件警报。 Each category will have number of email endpoints. 每个类别都会有多个电子邮件端点。

So creating a topic for each category feasible? 那么为每个类别创建一个主题可行吗?

for example - if my each area has 3 categories, I'll have to create a topic for each category. 例如-如果我的每个区域都有3个类别,则必须为每个类别创建一个主题。 so each area will have three tpoics and each topic will have some subscribers. 因此,每个区域将有3个主题,每个主题将有一些订阅者。

I want to ask, is this the correct way or are there better options? 我想问一下,这是正确的方法还是有更好的选择?

About the scenario, you mentioned, I guess Filter policy for SNS suits best. 关于您提到的方案,我想SNS的筛选器策略最适合。 You can also follow this AWS tutorial ' Filter Messages Published to Topics ' for this. 您也可以按照此AWS教程“ 过滤发布到主题消息 ”。

The idea of filter policy is very simple, 过滤策略的思想很简单,
When publishing message to topic, you also include some attributes(metadata) in your message for example area=2, category=3 将消息发布到主题时,您还要在消息中包含一些属性(元数据),例如area = 2,category = 3
Now this message will be only sent to those subscribers who has this key-value pair mentioned in their subscription policy(attributes) or to all those who don't have any policy at all. 现在,此消息将仅发送给在其订阅策略(属性)中具有此键值对的那些订阅者,或发送给根本没有任何策略的所有订阅者。

You define subscription policy(attributes), while making subscribe request in your code from client side. 您定义订阅策略(属性),同时在客户端代码中发出订阅请求。

Sample message to publish (Note MessageAttributes in the message): 要发布的示例消息(请注意消息中的MessageAttributes):

{
  "Type" : "Notification",
  "MessageId" : "e3c4e17a-819b-5d95-a0e8-b306c25afda0",
  "TopicArn" : "arn:aws:sns:us-east-1:111122223333:MySnsTopic",
  "Message" : message body with transaction details . . .
  "Timestamp" : "2017-11-07T23:28:01.631Z",
  "SignatureVersion" : "1",
  "Signature" : signature . . .
  "UnsubscribeURL" : unsubscribe URL . . .
  "MessageAttributes" : {
    "customer_interests" : {"Type":"String.Array","Value":"[\"soccer\", \"rugby\", \"hockey\"]"},
    "store" : {"Type":"String","Value":"example_corp"},
    "event" : {"Type":"String","Value":"order_placed"},
    "price_usd" : {"Type":"Number","Value":210.75}
  }
}

Sample subscriber policy: 样本订户策略:

{
    "store": ["example_corp"],
    "event": [{"anything-but":"order_cancelled"}],
    "customer_interests": ["rugby", "football", "baseball"],
    "price_usd": [{"numeric":[">=", 100]}]
}

About Limits: 关于限制:
By default, SNS offers 10 million subscriptions per topic, and 100,000 topics per account. 默认情况下,SNS每个主题提供1000万个订阅,每个帐户提供100,000个主题。 To request a higher limit, please contact Support. 要请求更高的限制,请联系支持。 Link 链接

I hope this answer puts you in the right direction to now think/move in 我希望这个答案能给您正确的方向,让您现在思考/前进

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM