Edition 0 Updated to asp. Net core 0



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə251/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   247   248   249   250   251   252   253   254   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Provide fallbacks
. In this approach, the client process performs fallback logic when a request fails, 
such as returning cached data or a default value. This is an approach suitable for queries, and is more 
complex for updates or commands. 
Limit the number of queued requests
. Clients should also impose an upper bound on the number 
of outstanding requests that a client microservice can send to a particular service. If the limit has been 
reached, it’s probably pointless to make a
dditional requests, and those attempts should fail 
immediately. In terms of implementation, the Polly 
Bulkhead Isolation
 policy can be used to fulfill this 
requirement. This approach is essentially a parallelization throttle with 
SemaphoreSlim
 as the 
implementation. It also permits a “queue” outside the bulkhead. You can proactively shed excess load 
even before execution (for example, because capacity is deemed full). This makes its response to 


296 
CHAPTER 7 | Implement resilient applications 
certain failure scenarios faster than a circuit breaker would be, since the circuit breaker waits for the 
failures. The BulkheadPolicy object in 
Polly
 exposes how full the bulkhead and queue are, and offers 
events on overflow so can also be used to drive automated horizontal scaling. 
Additional resources 

Resiliency patterns
https://learn.microsoft.com/azure/architecture/framework/resiliency/reliability-patterns
 

Adding Resilience and Optimizing Performance
https://learn.microsoft.com/previous-versions/msp-n-p/jj591574(v=pandp.10)
 

Bulkhead.
GitHub repo. Implementation with Polly policy. 
https://github.com/App-vNext/Polly/wiki/Bulkhead
 


Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   247   248   249   250   251   252   253   254   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin