private QueueClientOptions getSecondaryStorageOptions(TenantConfiguration config, out TestExceptionPolicy testExceptionPolicy, int numberOfReadFailuresToSimulate = 1, bool simulate404 = false, List <RequestMethod> enabledRequestMethods = null) { QueueClientOptions options = GetOptions(); options.GeoRedundantSecondaryUri = new Uri(config.QueueServiceSecondaryEndpoint); options.Retry.MaxRetries = 4; testExceptionPolicy = new TestExceptionPolicy(numberOfReadFailuresToSimulate, options.GeoRedundantSecondaryUri, simulate404, enabledRequestMethods); options.AddPolicy(testExceptionPolicy, HttpPipelinePosition.PerRetry); return(options); }
public QueueClientOptions GetOptions() { var options = new QueueClientOptions { Diagnostics = { IsLoggingEnabled = true }, Retry = { Mode = RetryMode.Exponential, MaxRetries = Constants.MaxReliabilityRetries, Delay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.01 : 1), MaxDelay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.1 : 60) }, }; if (Mode != RecordedTestMode.Live) { options.AddPolicy(new RecordedClientRequestIdPolicy(Recording), HttpPipelinePosition.PerCall); } return(InstrumentClientOptions(options)); }