Home » Microsoft » AZ-203 » What code should you insert on line DB07?
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:
Correct Answer:
Explanation/Reference:
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
Develop Azure Platform as a Service Compute Solutions 02
Microsoft AZ-204: Developing Solutions for Microsoft Azure
Free dumps for AZ-204 in PDF format also you can read online.
High quality AZ-204 PDF and software. VALID exam to help you pass.
|
|