通过过滤将消息从Amazon SNS路由到SQS [英] Routing messages from Amazon SNS to SQS with filtering

查看:146
本文介绍了通过过滤将消息从Amazon SNS路由到SQS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在RabbitMQ中,可以创建一个交换,然后将其绑定到多个队列,每个队列都有一个路由密钥.这样可以启用以下消息传递体系结构:

In RabbitMQ, one can create an exchange, then bind it to multiple queues, each with a routing key. This enables messaging architectures like this:

           message_x
         /    |     \
foo-msg_q  bar-msg_q  msg-logger_q

客户端将消息发布到message_x交换,该消息将具有路由键"foo"的消息路由到foo-msg_q队列,仅具有路由键的消息"bar"到bar-msg_q队列, all 消息到msg-logger_q队列.

Clients publish messages to the message_x exchange, which routes only messages with routing key "foo" to the foo-msg_q queue, only messages with the routing key "bar" to the bar-msg_q queue, and all messages to msg-logger_q queue.

我在弄清楚如何在AWS中执行此操作时遇到了麻烦.我的第一个想法是在各个队列上设置权限以接受基于主题的消息,但是权限条件唯一可用的字段是:

I'm having trouble figuring out how to do this in AWS. My first thought was to set up permissions on the individual queues to accept messages based on subject, but the only available fields for permission conditions are:

  • aws:CurrentTime
  • aws:EpochTime
  • aws:MultiFactorAuthAge
  • aws:principaltype
  • aws:SecureTransport
  • aws:SourceArn
  • aws:SourceIp
  • aws:UserAgent
  • aws:userid
  • aws:用户名
  • aws:CurrentTime
  • aws:EpochTime
  • aws:MultiFactorAuthAge
  • aws:principaltype
  • aws:SecureTransport
  • aws:SourceArn
  • aws:SourceIp
  • aws:UserAgent
  • aws:userid
  • aws:username

这些似乎都不受我发布到message_x主题的任何消息的影响.

None of these seem like they can be influenced by any message I publish to the message_x topic.

当使用Amazon Simple Notification Service散布到多个Simple Queue Service队列,并且每个队列接收发布到该主题的消息的子集时,是否可以做这样的事情?

Is it possible to doing something like this when using Amazon Simple Notification Service to fan out to multiple Simple Queue Service queues, with each queue receiving a subset of messages published to the topic?

推荐答案

编辑

我无法删除接受的答案,因此请参阅下面的答案,以获取当前正确的答案,因为此功能已发布

EDIT

I cannot delete an accepted answer, so see the answer below for the now correct answer since this feature has been released.

不,这不可能.对于他们来说,将是一个很棒的功能 但是.

No it's not possible. Would be a great feature for them to add though.

我知道的唯一替代方法是为每个路由规则创建一个主题 然后发布到正确的主题.不是很漂亮,但是 完成任务.如果您有很多规则,则可能需要 他们允许的3000多个主题.您可以要求增加 按照说明从AWS在其网站上进行主题限制 这里 http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ses_quota .

The only alternative I know is to create a topic for each routing rule and then publish to the correct topic. It's not pretty, but it accomplishes the task. If you have a lot of rules, you might need more than the 3000 topics they allow. You can request an increase in topic limit from AWS on their website by following the instructions here http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ses_quota.

这篇关于通过过滤将消息从Amazon SNS路由到SQS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆