exam questions

Exam AZ-203 All Questions

View all questions & answers for the AZ-203 exam

Exam AZ-203 topic 18 question 1 discussion

Actual exam question from Microsoft's AZ-203
Question #: 1
Topic #: 18
[All AZ-203 Questions]

HOTSPOT -
You need to configure retries in the LoadUserDetails function in the Database class without impacting user experience.
What code should you insert on line DB07?
To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer: Explanation
Box 1: Policy -

RetryPolicy retry = Policy -
.Handle<HttpRequestException>()
.Retry(3);
The above example will create a retry policy which will retry up to three times if an action fails with an exception handled by the Policy.
Box 2: WaitAndRetryAsync(3,i => TimeSpan.FromMilliseconds(100* Math.Pow(2,i-1)));
A common retry strategy is exponential backoff: this allows for retries to be made initially quickly, but then at progressively longer intervals, to avoid hitting a subsystem with repeated frequent calls if the subsystem may be struggling.
Example:

Policy -
.Handle<SomeExceptionType>()
.WaitAndRetry(3, retryAttempt =>
TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
);
References:
https://github.com/App-vNext/Polly/wiki/Retry

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
purav1009
Highly Voted 5 years, 2 months ago
Options without answer: https://www.examtopics.com/assets/media/exam-media/02522/0010300001.jpg
upvoted 15 times
...
gssicftohbcrcsgtjg
Highly Voted 5 years, 2 months ago
options https://www.examtopics.com/assets/media/exam-media/02522/0010400001.jpg
upvoted 10 times
...
sidnyc
Most Recent 4 years, 9 months ago
https://docs.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific search for Policy.Handle<Exception>().WaitAndRetryAsync
upvoted 1 times
...
sagnikmukh
5 years, 2 months ago
It should be Circuit Breaker.
upvoted 1 times
chintan4190
5 years, 1 month ago
I think - WaitAndRetryAsync(3,i => TimeSpan.FromMilliseconds(100* Math.Pow(2,i-1))); is correct. https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-circuit-breaker-pattern "The Circuit Breaker pattern has a different purpose than the "Retry pattern". The "Retry pattern" enables an application to retry an operation in the expectation that the operation will eventually succeed. The Circuit Breaker pattern prevents an application from performing an operation that's likely to fail. An application can combine these two patterns. However, the retry logic should be sensitive to any exception returned by the circuit breaker, and it should abandon retry attempts if the circuit breaker indicates that a fault is not transient."
upvoted 9 times
...
...
wlfjck
5 years, 3 months ago
https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago