Sitecore 10 xConnect Circuit Breaker Issue


 

Recently we have done Sitecore upgradation from 9.1 to 10.1. While doing the setup on Sitecore 10.1, I faced the below issue-

Sitecore.XConnect.XdbCollectionUnavailableException: An error occurred while sending the request



 What is Circuit breaker?

Circuitbreaker is a design pattern used in software development. It is used to detect failures and encapsulates the logic of preventing a failure from constantly recurring, during maintenance, temporary external system failure or unexpected system difficulties.

 Sitecore uses the PollyCircuit Breaker library and has added a Polly.IAsyncPolicy<HttpResponseMessage> type field to to the Sitecore.Xdb.Common.Web.CommonWebApiClient<TRoutes> class. This allows you to do a dependency injection of the Polly.CircuitBreaker class, which is an implementation of Polly.IAsyncPolicy.

 

How to fix the error? 

You enable CircuitBreaker configurations by patch file to manage xConnect requests from the Content Management role.

To create a CircuitBreaker configuration:

1) Go to the <wwwroot>/App_Config/Include/ folder of your Sitecore instance.

2) Create a patch file named, for example, CircuitBreakerCommon.config with the following configuration:

<CircuitBreaker

  name="CircuitBreakerCommon"

  type="Sitecore.XConnect.Client.WebApi.Policies.CircuitBreakerInfo, Sitecore.XConnect.Client" >

    <param desc="Key">General</param>

    <param desc="handledEventsAllowedBeforeBreaking">2</param>

    <param desc="durationOfBreak">15</param>

</CircuitBreaker> 

 

3)Save the patch file.

 You can find much more information in Sitecore documentation, please see the resources/further reading section at the end for more, happy reading!! 

 Further Reading:

·                  Configure a circuit breaker for xConnect

·                  Sitecore Downloads: Release Notes

·                  Circuit Breaker · App-vNext/Polly Wiki (github.com)

Comments

Post a Comment

Popular posts from this blog

Setup New Project in Sitecore XMCloud – Part 1

Step by Step installation of Sitecore 10.3 on Docker

Step by Step installation of Sitecore 10.3 on Azure PaaS