AWS Integration and Messaging Flashcards
(30 cards)
SQS Standard queue
- Used to decouple applications
- unlimited throughput and number of messages in queue
- can have duplicate and out of order messages
SQS Message retention
default 4 days up to 14 days
What does DeleteMessageAPI do?
Deletes messages from queue once they have been consumed
SQS Access Policies
Allow for cross-account access to SQS queues, allow for other services to write to SQS queue
Cross account access with SQS queues
Use queue access policy to allow a resource in one account to receive messages from SQS queue in another account (use sqs:ReceiveMessage action)
Publish event notifications to SQS queue
Use queue access policy to let S3 bucket send message to SQS queue (use sqs:SendMessage action)
Message Visibility Timeout
After a message is polled by a consumer, it is invisible to other consumers (timeout default is 30 seconds)
ChangeMessageVisibility API
Consumer can use this to get more time to process a message if it will take longer than the message visibility timeout window
MaximumReceives threshold
Threshold of how many times a message can go back into the queue (if consumer fails to process the message within Visibility Timeout)
Dead Letter Queue
Message goes to DLQ after MaximumRecives threshold is exceeded
DQL of a queue must be …
The same type eg. DLQ of FIFO queue must also be FIFO queue
What is redrive to source?
Can redrive messages from DLQ to source queue after code has been fixed
Delay queue
Delay a message so consumers don’t see it immediately (up to 15 minutes), default is 0 seconds
Long polling
When consumer requests messages from queue, can optionally wait for messages to arrive if non are in the queue (decreases number of API calls and latency)
SQS Extended Client
Used to send messages over 256kb by sending large message to s3 bucket (eg. for large media files)
SQS Queue message size limit
256kb
SQS Queue API calls for long polling
ReceiveMessageWaitTimeSeconds
SQS FIFO Queue
-First In First Out ordering of messages in the queue
- messages processed in order by consumer
- has exactly-once send capability (remove duplicates)
Two deduplication methods for FIFO queues
Content based deduplication (SHA-256 hash of message body) and Message Deduplication ID
Message grouping
Specify different values for MessageGroupID to get ordering at the level of a subset of messages
Amazon SNS
Event producer only sends message to one SNS topic, many event receivers listen to the SNS topic notifications
SNS + SQS Fan Out
Push once in SNS, receive in all SQS queues that are subscribers (allows for cross region delivery)
fan out pattern with s3 bucket
send s3 event to SNS topic, which sends to many SQS queues that are subscribed
Can you do SNS FIFO queue?
Yes