SQS stands for Amazon Simple Queue Service.It is flexible, reliable, secure, highly-scalable, easy & fully managed message queuing service for storing unlimited messages.Using SQS we can sends multiple message at same times.It support two types of queue, Standard and FIFO (First In First Out) queues."Standard" queues are available in all regions & "FIFO" queues are available only in the US East (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland) regions.If you don't specify the FifoQueue attribute while creating queue then by default it will create a Standard queueAWS SQS does not delete message once it has been received by receiver because of distributed system and it has no guarantee that receiver received that message or not due to some technical difficulties. Therefore it is receiver responsibility to delete message from queue. SQS provides 'visibility period' is a period for which message become unavailable for specific period after being received by consumer / receiver.Use Case:You can use Amazon SQS when you want to move data between distributed application components.Lets see one by one...How to create a queue:It require query name and attributes like DelaySeconds, MaximumMessageSize etc. we can also save these attribute values in a JSON file and pass it instead of passing attributes directly.Create a JSON file name as attributejson.json and write below attribute.{"MessageRetentionPeriod":"259200"} This parameter tells AWS SQS to persist the message in query for that particular time in seconds.In above example we set it for 3 days (3 days * 24 hours * 60 minutes * 60 seconds).$ aws sqs create-queue --queue-name pgqueue --attributes file://attributejson.jsonOnce you execute command above it will output the URL of newly created queue. Save this URL for future utilization.Output:{ "QueueUrl": "https://queue.amazonaws.com/099998EXA..."}To verify we can use command below.$ aws sqs list-queues How to send messages in new SQS Queue:$ aws sqs send-message --queue-url --message-body "This is my first queue message"AWS provides 'send-message' command to send message to any specified queue and parameter we need to pass --queue-url and --messgae-body.Once we execute above command it will send that message into that queue. You can also verify this from AWS management console.How to receive/delete queue message:AWS provides a command that is --receive-message and only one parameter need to pass which is --queue-url from which want to receive messages.$ aws sqs receive-message --queue-url From the output you can note receipt-handle to delete this message in future.$ aws sqs delete-message --queue-url --receipt-handleHow to send message with delay in queue:We can send message in queue with specific time delay that means the message will be available for processing after that delayed time finished.$aws sqs send-message --queue-url --message-body "Message with 10 second delay" --delay-seconds 10Here we set delay of 10 seconds that means the message will be delivered to queue after 10 seconds. in this command we just need to pass extra parameter i.e --delay-seconds with value in seconds.How to delete SQS queue:SQS provides a command delete-queue with parameter queue-url to delete queue.$aws sqs delete-queue --queue-urlWe can verify deleted queue by command below.$ aws sqs list-queues
PHP Web Technology Funda | AWS Cloud
Read my blog here : https://www.howtoinmagento.com/
Tips & Tricks of PHP Frameworks & AWS Cloud Computing
aws sqs,sqs cli,sqs,amazon sqs,aws endpoints,sqs pricing,amazon aws ec2,aws queue,aws sns pricing,aws sns topic,sns vs sqs,sqs lambda,sqs queue,amazon lambda tutorial,aws push notifications,aws scheduled tasks,aws sqs pricing,sns lambda,sqs limits,aws lambda context,aws lambda invoke,aws lambda node,aws lambda python tutorial,aws lambda scheduled,aws lambda supported languages,aws lambda timeout,aws sqs queue,define aws,nodejs queue,sns sqs,sqs vs kinesis,aws messaging,aws sns vs sqs,aws sqs cli,aws sqs limits,sns message,sqs message size,sqs receivemessage,amazon aws lambda,amazon aws regions,amazon queue,amazon simple queue service,amazon sqs tutorial,aws sns limits,aws subscription,simple queue service,sqs message,what is sqs