Integration & Messaging Flashcards
What are some of the main attributes of the SQS standard queue?
Unlimited throughput, unlimited number of messages on a queue. Default retention of 4 days maximum of 14. Low latency, max message size of 256Kb. Can have duplicate messages (at least once delivery). Can have out of order messages (best effort ordering).
What are two common use cases of a SQS queue policy?
Cross account access - using a EC2 instance in one account to poll the queue in a different account. Publish events from S3 to a SQS queue.
How do you allow an EC2 instance to poll an SQS queue in a different account?
Use a SQS queue policy with an allow effect, a principal of the other AWS account, an action of recieveMessage and a resource of the queue in question.
How do you configure access to allow events from S3 to be pushed into an SQS queue?
Use a SQS queue policy with an allow effect, a principal of any AWS account, a condition to restrict the source ARN to be that of the S3 bucket, and a source account to be equal to the account of the S3 bucket.
What is SQS message visibility timeout?
After a message is polled by a consumer it becomes invisible to other consumers.
Can the SQS message visibility timeout be extended by a consumer?
Yes, if the consumer knows it needs a bit more time to process the message it can make a ChangeMessageVisibility API call to the Queue
What is the SQS dead letter queue?
A queue for messages that have been received too many times, possibly because the message is malformed or an error has occurred. Useful for debugging. The type of dead letter queue matches that of the original queue (standard vs FIFO).
What is the “Redrive to source” feature of the dead letter queue?
Ability to send messages on the dead letter queue back into the original queue, for example after a bug has been fixed.
What is the SQS delay queue?
Delay a message from being consumed for up to 15mins using the delivery delay attribute.
What is SQS long polling?
Poll for messages for an extended period, to reduce the number of API calls the consumer needs to make to increase efficiency and decrease latency, better than short polling for most apps.
What is the SQS extended client?
A simple java based library to allow for larger messages. This is more of a concept, as this can be implemented in other languages. Message gets sent into a S3 bucket first, a small pointer message gets put onto the queue, consumer then gets data from the bucket.
How would you use a SQS queue to send large messages?
Use the extended client (java library or similar) . This will put the message into a S3 bucket first then sends a small message onto the queue with a reference to the S3 object.
What is a FIFO queue?
First in first out queue for ordering of messages. Has limited throughput, exactly one send capability (prevent duplicates). Messages processed in order by consumer.
What is FIFO de-duplication interval?
The amount of time that a duplicate message should be ignored before it should be accepted onto the queue.
What is the purpose of the message group id in a FIFO queue?
Ordering of messages is maintained within a message group. Lets you have multiple consumers, each one consuming a specific message group.
What is Amazon SNS?
Simple Notification Service, Pub-Sub - lets you send a message to a topic and multiple consumers can subscribe to the topic to receive messages.
What are some examples of SNS subscribers?
Directly send emails or mobile messages. Call HTTP endpoints. An SQS queue. Lambda. Kinesis data firehose.
What is the SNS & SQS “Fan Out” pattern?
Messages are put onto a SNS topic, and then consumed by multiple SQS queues. Fully decoupled, no data loss, each SQS queue can manage the message itself. Future proofing for additional SQS queues.
Can you have a FIFO SNS queue?
Yes, messages sent to a FIFO SNS topic will be delivered to the subscribers in order.
What is SNS message filtering?
JSON policy to filter messages for subscribers of a topic