Routing messages from Amazon SNS to SQS with filtering

EDIT

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

Original (now incorrect) Answer (for posterity):

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

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.


This is possible by using message attribute filtering in SNS. After you subscribe different SQS queues to an SNS topic, you can specify attributes to filter on by using the SNS API SetSubscriptionAttributes. This will allow messages with different attributes to get routed to the correct SQS queue.

This is also not limited to SQS queues but any subscription sources on a SNS topic. For example, a single SNS topic can publishing one set of messages to Lambda, and another set to SQS.

SDK Reference: http://docs.aws.amazon.com/sns/latest/api/API_SetSubscriptionAttributes.html

More details are given here with examples: https://aws.amazon.com/blogs/compute/simplify-pubsub-messaging-with-amazon-sns-message-filtering/