Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified Solutions Architect - Professional SAP-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional SAP-C02 exam

Exam AWS Certified Solutions Architect - Professional SAP-C02 topic 1 question 141 discussion

A company is processing videos in the AWS Cloud by Using Amazon EC2 instances in an Auto Scaling group. It takes 30 minutes to process a video Several EC2 instances scale in and out depending on the number of videos in an Amazon Simple Queue Service (Amazon SQS) queue.

The company has configured the SQS queue with a redrive policy that specifies a target dead-letter queue and a maxReceiveCount of 1. The company has set the visibility timeout for the SQS queue to 1 hour. The company has set up an Amazon CloudWatch alarm to notify the development team when there are messages in the dead-letter queue.

Several times during the day. the development team receives notification that messages are in the dead-letter queue and that videos have not been processed property. An investigation finds no errors m the application logs.

How can the company solve this problem?

  • A. Turn on termination protection tor the EC2 Instances
  • B. Update the visibility timeout for the SQS queue to 3 hours
  • C. Configure scale-in protection for the instances during processing
  • D. Update the redrive policy and set maxReceiveCount to 0.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
masetromain
Highly Voted 1 year, 10 months ago
Selected Answer: C
The correct answer is C. The company can solve the problem by configuring scale-in protection for the instances during processing. This will ensure that the instances are not terminated while they are processing videos. This will prevent the messages from moving to the dead-letter queue and ensure that videos are processed properly. Option A is incorrect because turning on termination protection for the EC2 instances will not solve the problem as it will impact the ability of the Auto Scaling group to scale instances in and out based on the number of videos in the queue. Option B is incorrect because the company has specified a visibility timeout of 1 hour, which is enough time for the instances to process a video and there is no need to update the timeout to 3 hours. Option D is incorrect because the company has set the maxReceiveCount to 1 and changing it to 0 will not solve the problem. maxReceiveCount allowed range is 1 to 1000.
upvoted 27 times
[Removed]
1 year, 4 months ago
fully agree, option d is inocrrect because 0 is an invalida value for maxReceiveCount
upvoted 1 times
...
Bwitch
1 year, 6 months ago
ChatGPT confirms this reasoning.
upvoted 8 times
...
...
venvig
Highly Voted 1 year, 2 months ago
Selected Answer: C
Refer https://aws.amazon.com/blogs/aws/new-instance-protection-for-auto-scaling/ From the above link, "an instance might be handling a long-running work task, perhaps pulled from an SQS queue. Protecting the instance from termination will avoid wasted work" - This is what the question is also alluding to. This is how one would make use of the functionality. You change the protection status of one or more instances by calling the SetInstanceProtection function. If you wanted to use this function to protect long-running, queue-driven worker processes from scale-in termination, you could set up your application as follows (this is pseudocode): while (true) { SetInstanceProtection(False); Work = GetNextWorkUnit(); SetInstanceProtection(True); ProcessWorkUnit(Work); SetInstanceProtection(False); }
upvoted 6 times
...
Jorkaef
Most Recent 1 week ago
Correct is C: B. 3-hour visibility timeout Too long for 30-minute processing Could delay reprocessing of failed messages Doesn't address root cause C. Scale-in protection during processing Prevents instance termination while processing Allows message processing to complete Prevents message return to queue Stops premature scale-in ✓ CORRECT
upvoted 1 times
...
Jorkaef
1 week, 5 days ago
B is correct; updating the visibility timeout to 3 hours (option B) is the most appropriate solution as it gives enough time for the messages to be processed without being prematurely marked as failures.
upvoted 1 times
...
trungtd
5 months, 2 weeks ago
Selected Answer: D
D is a typo
upvoted 1 times
...
VerRi
9 months ago
Selected Answer: D
If Option D is a typo, then D
upvoted 1 times
...
Greanny
10 months ago
B. The best solution for this problem is to update the visibility timeout for the SQS queue to 3 hours. This is because when the visibility timeout is set to 1 hour, it means that if the EC2 instance doesn't process the message within an hour, it will be moved to the dead-letter queue. By increasing the visibility timeout to 3 hours, this should give the EC2 instance enough time to process the message before it gets moved to the dead-letter queue. Additionally, configuring scale-in protection for the EC2 instances during processing will help to ensure that the instances are not terminated while the messages are being processed.
upvoted 2 times
...
tmlong18
10 months, 2 weeks ago
Selected Answer: D
Option D is a typo. I seen the same question in udemy but the Option D is 10
upvoted 4 times
...
career360guru
11 months, 1 week ago
Selected Answer: C
Option C is correct.
upvoted 2 times
...
severlight
1 year ago
Selected Answer: C
setting MaxReceiveCount to 0 doesn't make and send and it impossible, because messages would be send to DLQ without any attempt to consume them from source queue
upvoted 1 times
...
Russs99
1 year, 2 months ago
Selected Answer: D
checked 4 AI, C is definitely not the correct answer: Option C: Configuring scale-in protection for the instances during processing will not prevent messages from being moved to the dead-letter queue if they cannot be processed on the first attempt.
upvoted 1 times
...
SK_Tyagi
1 year, 3 months ago
Selected Answer: C
Going with C only because D has value of maxReceiveCount set to 0
upvoted 2 times
...
rtguru
1 year, 4 months ago
I go with C
upvoted 1 times
...
YodaMaster
1 year, 4 months ago
Selected Answer: B
B. AWS "recommends setting your queue's visibility timeout to six times your function timeout" which makes 3 hours perfect. source: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
upvoted 2 times
ajeeshb
8 months, 2 weeks ago
But this for a queue to use with lambda. Here it is EC2 in ASG
upvoted 1 times
...
...
NikkyDicky
1 year, 4 months ago
Selected Answer: C
C more likely
upvoted 1 times
...
Maria2023
1 year, 5 months ago
I couldn't find any way to configure scale-in protection for the instances during processing except to do it manually, which is going to be an insane exercise. Eventually, that can be done by the application as part of the processing but I would then expect some more context in the answer.
upvoted 1 times
...
dev112233xx
1 year, 6 months ago
Selected Answer: D
D makes sense I think D answer has a typo! probably they didn't copy the text properly https://repost.aws/knowledge-center/lambda-retrying-valid-sqs-messages
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...