简体   繁体   中英

How to use AWS SQS and SNS to send notification message to website?


I have an email system in my website and as of now there is no way to show notification to user in my website. Until unless user login to email client they will not come to know that they have received a message.


Can i accomplish this with the help of AWS SQS and SNS? As this a website, there are many registered user. They will be sending message to any user and say when the recipient of the email is active & logged into the website, i need to display a notification. If user is offline, i just need to show these messages on header of the page when they login. How can i do this?

I tried creating message queue in AWS console(SQS) and Subscribed Queue to SNS Topic from SQS management console. I can try sending message to this queue but i am not sure how to distribute unique user related message as notification?


Please let me know if you have any suggestions for this?

I am using JAVA

Neither SNS nor SQS are good candidates for your use case. I would recommend putting the message in some kind of data store and querying that data store on page load to determine if you should display the notification.

Options include:

  1. A SQL database (if you already have one, otherwise this is a pricy option)
  2. DynamoDB (highly available and very fast, but kind of expensive option)
  3. SimpleDB (highly available, kind of slow, and can't handle much throughput, good query capability, cheap)
  4. S3 (highly available, kind of slow, high throughput, poor querying capabilities, cheapest option)

If you are not wed to the AWS stack you can take a look at Azure Table which probably meets your needs slightly better than any of those.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM