Reputation: 2340
Is there anyway to route between SNS topics or apply filters to subscribers - if not have I got my design wrong?
I have around 10 systems that will create messages of around 15 different types for consumption a pool of around 1000 subscribers, most of the subscribers will only be interested in one message type and most of those will only be interested in about 1/1000 of the messages.
What I would like to do is either have inter topic routing or be able to put a filter between a subscriber and the topic, is SNS the wrong product, is my design wrong or is there some feature I'm not aware of?
Upvotes: 3
Views: 1708
Reputation: 179374
SNS delivers all messages for a topic to all endpoints. It does not have inter-topic routing (which would enable you to build a mesh of source topics and target topics and "wire" them together so that each group of subscribers got messages from the group of sources you wanted them to see) and it does not have a filter mechanism.
The partial exception to this is Mobile Push, where individual endpoints are addressable but not filterable, and this is only applicable to apps on mobile devices.
If this isn't a mobile app situation, and the subscribers will only be interested in a tiny minority of notifications, then SNS might not be the right platform, since you'll be paying for all of those thousands of unneeded deliveries.
Depending on the nature of the messages and the degree of selectivity you need, you could fairly easily write an intermediate dispatcher in any number of different programming languages that listened to a set of source topics and rebroadcast the messages to a set of destination topics in sensible combinations (Topic A and B messages are resent to all interested subscribers of Topic X ... Topic B and C messages are delivered via Topic Y ... etc.).
If it is a mobile app, you'd still need an intermediate piece of software that listened to the source messages and relayed those messages to the appropriate mobile devices individually based on a set of rules.
Upvotes: 1