SQS does not provide notification, but if there is a new message in SQS, can you create everything that created the message, click node.js and enable polling for several minutes. You may not be able to control what is in your queue, but if so, I would ask him to run node.js to start polling the queue.
If you are concerned about the survey because of the cost, you can do what I did - dynamically change the time of the survey. SQS queues are checked every 5 seconds. If node detects a message, it immediately increases the polling time to 200 ms in a few seconds. If it does not find a message in the queue, it slows down 50 ms every empty request until the 5 second polling is deleted again.
This first request will be slow, which you may not be able to handle. To combat this, my polling time is randomly accelerated every few minutes. When polling multiple nodes, the response time is usually very fast.
Hairgami_master
source share