问题
I developed a web application which serves a html page when user visits the link and displays some data according to keywords entered. Now data is being populated on the go, so I want to model something like when a new piece of data is stored(in elastic search) a SNS notification is generated which is shown to the person who is viewing the webpage. I got the SNS notification working, but I am stuck on the part that how do I display this notification on the front end? Can I do something like this that SNS pushes data to the a SQS queue and Javascript polls the queue and picks up the generated notification and displays it or there is a better way? PS:I dont know NodeJS
回答1:
Yes, you can definitely do that "SNS pushes data to the a SQS queue and Javascript polls the queue and picks up the generated notification and displays".
Other way can be that SNS can publish notifications even to an HTTP endpoint, so in your web app you can have a SNS subscriber and then the SNS can directly publish notifications to the web app and then from there you can pass this to your clients just like any other data
来源:https://stackoverflow.com/questions/43444435/sns-notifications-to-browser