Setting up your own server will require good knowledge of the subject so that you do not leave any corner untouched. This is not the case with Amazon SQS as it is pretty quick to get started with. The beauty of SQS is also that things do not get lost–independent of any server–and also it eliminates two threads trying to do the same job and bumping heads. The beauty of SQS is also that things do not get lost–independent of any server–and also it eliminates two threads trying to do the same job and bumping heads. Once anything receives the message in the queue, they have an exclusive lease on it for a certain period of time. This makes it especially great once you need to scale to multiple worker servers. Each one just gets the next job in the queue and does its thing, independent of any of the others, and then removes it from the queue once done(from Jason Byrne). Once anything receives the message in the queue, they have an exclusive lease on it for a certain period of time. This makes it especially great once you need to scale to multiple worker servers. Each one just gets the next job in the queue and does its thing, independent of any of the others, and then removes it from the queue once done(from Jason Byrne). from Jason Byrne Remark: — Before starting steps below, Clone Sample Git, and do npm install. Sample Git Step: set up access-key and secret-key $ node sqs_createqueue.js $ node sqs_listqueues.js $ node sqs_getqueueurl.js (the reture url is used in step 5 and 6) $ node sendMessage.js $ node receiveMessage.js set up access-key and secret-key $ node sqs_createqueue.js $ node sqs_listqueues.js $ node sqs_getqueueurl.js (the reture url is used in step 5 and 6) $ node sendMessage.js $ node receiveMessage.js 1- set up access-key and secret-key Go to IAM management console to create an user whom the system is going to generate access-key and secret-key to (for more information). IAM management console IAM management console for more information Before creating the user, a configured group with SQS permission is required. In the permission windows, select the click-box for AmazonSQSFullAccess, and next. AmazonSQSFullAccess AmazonSQSFullAccess Add user to the group with access SQS permission. Generating access-key and secret-key, which will be used in config.json later. access-key access-key secret-key secret-key config.json config.json Create a config.json file under the Node.js directory, in which paste the access-key and secret-key which generated from the previous step to field accessKeyId and secretAccessKey. config.json config.json access-key access-key secret-key secret-key accessKeyId accessKeyId secretAccessKey secretAccessKey 2- Creating Queue Amazon not only brings us diverse Another great things Amazon provides us are, very easy to read documentation and super easy to use sample code. With the doc and git example, running the Helloworld example, sending/receiving message is just a piece of cake. diverse doc Creating a Queue run sqs_createqueue.js file $ node sqs_createqueue.js Success https://sqs.us-east-1.amazonaws.com/xxx/SQS_QUEUE_NAME List Queue $ node sqs_listqueues.js Success [ 'https://sqs.us-east-1.amazonaws.com/xxx/SQS_QUEUE_NAME' ] Get Queue Url $ node sqs_getqueueurl.js Success https://sqs.us-east-1.amazonaws.com/xxx/SQS_QUEUE_NAME https://sqs.us-east-1.amazonaws.com/xxx/SQS_QUEUE_NAME https://sqs.us-east-1.amazonaws.com/xxx/SQS_QUEUE_NAME In sendMessage.js, set value to valuable QueueUrl from the return result, and the message “Information about current NY Times…” is going to be sent: sendMessage.js QueueUrl message “Information about current NY Times…” message “Information about current NY Times…” Sending Message to Queue $ node sendMessage.js Success 169607bb-xxx-xxx-xxx-d4d1cc270e9f Receiving Message from Queue In receiveMessage.js, Set value to QueueUrl from the sqs_getqueueurl.js result: receiveMessage.js QueueUrl sqs_getqueueurl.js $ node receiveMessage.js { ResponseMetadata: { RequestId: 'f7ae9017-0692-5eae-874e-c0e0a13a070b' }, Messages: [ { MessageId: '169607bb-3d5a-4dab-a8bf-d4d1cc270e9f',ReceiptHandle: 'xxx',MD5OfBody: 'xxx',Body: 'Information about current NY Times fiction bestseller for week of 12/11/2016.', Attributes: [Object],MD5OfMessageAttributes: 'xxxx',MessageAttributes: [Object] } ] } Body: 'Information about current NY Times fiction bestseller for week of 12/11/2016.', Body: 'Information about current NY Times fiction bestseller for week of 12/11/2016.', Note Message Attribute VS Message Body — Message attributes are supposed to be used as message metadata (like timestamp or possibly some category) and not the message itself. Message attributes Message attributes — Reference: https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javascript/example_code/sqs https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javascript/example_code/sqs http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-using-queues.html http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-using-queues.html https://github.com/wahengchang/aws-sqs-example https://github.com/wahengchang/aws-sqs-example