⇒ can be problematic if there are sudden spikes of traffic
asynchronous / event based
⇒ scalable
Producing messages
define body
add message attributes (metadata - optional)
delay delivery (optional)
get back
message identifier
MD5 hash of body
Consuming messages
poll message from SQS (maximum 10 messages at a time)
process the message within the visibility timeout
delete the message using message ID & receipt handle
visibility timeout
when a consumer polls a message from a queue ⇒ the message is invisible to other consumers for a defined period ⇒ Visibility Timeout
0 second - 12 hours (default 30 seconds)
when consumer fails to process the message, the message is still invisible until Visibility Timeout finish ⇒ be carefull to set high Visibility Timeout (eg 15 minutes)
if too low (30 senconds) and consumer needs time to process the message (2 minutes) ⇒ another consumer will receive and process the message more than once
ChangeMessageVisibility API to change the visibility
DeleteMessage API to tell SQS the message was successfully processed