Question : You have defined a SQS queue and any user can send the message in it, and your application reads the message from the queue but before processing this message you want to validate whether it is a valid ip or not. So which of the following attribute from message will give you the ip address. 1. ip 2. ipaddress 3. SenderId 4. allipaddress 5. SenderIds
Correct Answer : 3
Explanation: Amazon SQS provides the IP address when the AWS account ID is not available such as when an anonymous user sends a message. SenderId" attribute value of a message in the case of anonymous access
Question : You want to read a message from the SQS queue, however you want the behaviour like blocking queue means until the message is available in the queue, it shpuld not return. Which of the following strategy will help for above scenerio ?
1. SQS long polling 2. SQS short polling 3. Creating SQS blocking queue 4. 1 and 2 5. All 1,2 and 3
Correct Answer : 1
Explanation: SQS long polling is a new way to retrieve messages from your SQS queues. While the traditional SQS short polling returns immediately, even if the queue being polled is empty, SQS long polling doesnt return a response until a message arrives in the queue, or the long poll times out. SQS long polling makes it easy and inexpensive to retrieve messages from your SQS queue as soon as they are available. In almost all cases, SQS long polling is preferable to SQS short polling. Long polling requests allow your queue consumers to receive messages as soon as they arrive in your queue, while reducing the number of empty ReceiveMessageResponses you encounter. Combined together, SQS long polling results in higher performance at reduced cost for the majority of use cases. However, if your application is written to expect an immediate response from a ReceiveMessage call, you may not be able to take advantage of long polling without some application modifications. For example, if your application has a single thread polling multiple queues, switching from short polling to long polling will likely not work, as the single thread will wait for the long poll timeout on any empty queues, delaying the processing of any queues which may contain messages. In such an application, it is recommended that a single thread be used to process only one queue, allowing for the application to take advantage of the benefits SQS long polling provides.
In general, the maximum long poll timeout of 20 seconds should be used. Higher long poll timeout values will reduce the number of empty ReceiveMessageResponses returned, so try to set your long poll timeout as high as possible. If the 20 second maximum does not work for your application, you can choose a shorter long poll timeout, down to as low as 1 second. All of the AWS SDKs work with 20 second long polls by default. If you are not using an AWS SDK to access SQS, or if youve specially configured your AWS SDK to have a shorter timeout, you may need to modify your SQS client to allow for longer requests or use a shorter long poll timeout.
Question : What are the features of the AmazonSQSBufferedAsync ?
1. AmazonSQSBufferedAsync client supports automatic batching of multiple SendMessage, DeleteMessage 2. AmazonSQSBufferedAsync client supports prefetching of messages into a local buffer 3. AmazonSQSBufferedAsync client supports prefetching of messages into a file in your application (So its durable) 4. 1 and 2 5. 1 and 3
Correct Answer : 4
Explanation: The AmazonSQSBufferedAsync client provides a new implementation for the AmazonSQSAsync client interface that adds several important features. First, the AmazonSQSBufferedAsync client supports automatic batching of multiple SendMessage, DeleteMessage or ChangeMessageVisibility requests into batches of each type, without any changes required by the application. Second, the AmazonSQSBufferedAsync client supports prefetching of messages into a local buffer, which allows your application to immediately process messages from SQS without waiting for them to be retrieved from SQS. Combined together, automatic batching and prefetching increases the throughput and reduces the latency of your application, while saving you money by making fewer SQS requests.
Question : What is "visibility timeout" in Amazon SQS queue ? 1. is a period of time during which Amazon SQS prevents other consuming components from receiving and processing that message, once it is processed by your component 2. is a period after submitting the message to queue will not be available to consumer because queue parse that message during this time. 3. is a period after this message will be deleted 4. is a period of till the message will remain in the queue
3. only be used to launch EC2 instances in the same AWS region as the AMI is stored. 4. only be used to launch EC2 instances in the same AWS availability zone as the AMI is stored