AWS Certified Developer - Associate Exam: Processing Data from Amazon S3 to Amazon SQS

AWS Developer Certification: Event-Driven Data Processing from Amazon S3 to Amazon SQS

Prev Question Next Question

Question

Developer Team is working on an event driven application that needs to process data stored in the Amazon S3 bucket & notify multiple subscribers using Amazon SNS.

Thus, a single topic is created in Amazon SNS & messages are pushed to multiple Amazon SQS queues subscribed to this topic.

Which of the following is a correct statement with regards to messages sent to the Amazon SQS queue?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - A.

When multiple Amazon SQS queues are subscribed to a single topic within an Amazon SNS, each queue will receive an identical message.

This is useful for parallel independent processing of messaging.

Option B is incorrect as All the queues subscribed to the topic will not get an evenly distributed message.

But all queues will have identical messages each time a message is pushed for a topic.

Option C is incorrect as there would be any time delay for receiving messages.

Option D is incorrect as All queue receives identical message & can start processing messages parallelly independent of other queues.

For more information on Fanout with Amazon SNS, refer to the following URL-

https://aws.amazon.com/getting-started/hands-on/send-fanout-event-notifications/

The correct answer to this question is (B) Message sent to the topic will be evenly distributed among all the queues which have subscribed to this topic.

When a message is sent to an Amazon SNS topic, it is delivered to all the subscribers of the topic. In this case, the subscribers are Amazon SQS queues that have been subscribed to the topic. Each queue will receive a copy of the message.

Amazon SNS uses a publish-subscribe model where a publisher sends a message to a topic, and all the subscribers receive a copy of the message. Amazon SQS is a message queue service, where a queue receives messages sent to it.

When an Amazon SQS queue is subscribed to an SNS topic, the messages sent to the topic are evenly distributed among all the queues that have subscribed to the topic. This ensures that the workload is evenly distributed among the subscribers, and no queue is overwhelmed with too many messages.

The delivery of messages to Amazon SQS queues is asynchronous, which means that there may be a delay between when a message is sent to the topic and when it is received by the queues. However, this delay is typically minimal, and messages are delivered to the queues within seconds.

It's important to note that Amazon SQS queues operate on a pull-based model, which means that the queues themselves retrieve messages from the topic. Therefore, messages will only be visible to the queue after it has retrieved them from the topic.

In summary, when a message is sent to an Amazon SNS topic with multiple Amazon SQS queues subscribed to it, the message will be evenly distributed among all the queues. Delivery to the queues is asynchronous, but the delay is typically minimal, and messages are retrieved from the topic by the queues in a pull-based model.