Configure xConnect transient fault handling during initialization

Version: 10.4

You can specify a retryer configuration when you initialize your xConnect clients independently, or when you initialize a new xConnect Client Configuration (XConnectClientConfiguration).

Specify a retryer configuration during xConnect client initialization

You can initialize the xConnect search, collection and configuration clients independently, by specifying a retry registry and a configured retryer name. The SearchWebApiClient, the CollectionWebApiClient, and the CollectionWebApiClient have overloads that accept IRetryRegistry and a configured retryerName.

To initialize the SearchWebApiClient with a retryer configuration, use the following code sample:

RequestResponse
new SearchWebApiClient(new Uri("http://xconnect.search"), clientModifiers, httpClientHandlerModifiers, executingPolicy, retryerRegistry,
retryerName);

To initialize the CollectionWebApiClient with a retryer configuration, use the following code sample:

RequestResponse
new CollectionWebApiClient(new Uri("http://xconnect.collection"), clientModifiers, httpClientHandlerModifiers, executingPolicy, retryerRegistry, retryerName);

To initialize the ConfigureWebApiClient with a retryer configuration, use the following code sample:

RequestResponse
new ConfigurationWebApiClient(new Uri("http://xconnect"), clientModifiers, httpClientHandlerModifiers, executingPolicy, retryerRegistry, retryerName);

Initialize the xConnect Client Configuration

The XConnectClientConfiguration object contains parameters that specify a retryer, and xConnect client URIs for search and collection services.

RequestResponse
public XConnectClientConfiguration( 
            XdbModel model,
            Uri collectionUri,
            Uri searchUri,
            bool enableDataExtraction,
            CircuitBreakerFactory circuitBreakerFactory,
            IRetryerRegistry retryerRegistry,
            string retryerName)

The following code sample shows how you can initialize the XConnectClientConfiguration with a retry strategy for the collection service and search service:

RequestResponse
new XConnectClientConfiguration(CollectionModel.Model,
new Uri("http://xconnect.collection"), new Uri("http://xconnect.search"), true, null, retryerRegistry, retryerName)

Do you have some feedback for us?

If you have suggestions for improving this article,