I'm just getting started with SNS and as far as I see you cannot simply subscribe to the publisher and listen to events. You have to i). create a publically accessible callback (url/email/sms), ii). register it with the service and iii). build a consumer specific to the type of callback.
I want to use an API similar to this:
const client = new SnsClient({
region: 'eu-west-1',
topicArn: 'XXX'
})
client.on('connection', (connection) => {
connection.on('notification', (notification) => {
// do some work with notification
})
})
Am I missing something? I want to have X number of web servers listening to a single event (fanout).
For instance my worker might be an EC2 instance on a private subnet, so the available subscriptions: "http(s)", "email", "sms" wouldn't work**. "SQS" could work but you have to set a queue up for each instance and it uses long polling rather than push. "application" and "lambda" are not applicable.
Is AWS SNS suitable for this use case? If not is there an alternative AWS service?
** You might be able to get https to work but only with overly complex roles/dns.
Edit: I think what I want to do is similar to Google Cloud PubSub Subscription or RabbitMQ but using a native (AWS) rather than 3rd party service.