private IEasyCachingBus CreateDecoratedProvider() => ServiceBuilders.CreateFakeBus(options => { options.BusFactory = CreateBus; options.DecorateWithPublishFallback( exceptionFilter: exception => exception is InvalidOperationException); });
private IEasyCachingBus CreateDecoratedProvider() => ServiceBuilders.CreateFakeBus(options => { options.BusFactory = CreateBus; options.DecorateWithRetry( retryCount: 1, exceptionFilter: exception => exception is InvalidOperationException); });
protected IEasyCachingProvider CreateDecoratedProvider() => ServiceBuilders.CreateFakeProvider(options => { options.ProviderFactory = CreateProvider; var circuitBreakerParameters = new CircuitBreakerParameters( exceptionsAllowedBeforeBreaking: 1, durationOfBreak: TimeSpan.FromMinutes(1)); options.DecorateWithCircuitBreaker( initParameters: circuitBreakerParameters, executeParameters: circuitBreakerParameters, exception => exception is InvalidOperationException); });
protected IEasyCachingBus CreateDecoratedProvider() => ServiceBuilders.CreateFakeBus(options => { options.BusFactory = CreateBus; var circuitBreakerParameters = new CircuitBreakerParameters( exceptionsAllowedBeforeBreaking: 1, durationOfBreak: TimeSpan.FromMinutes(1)); options.DecorateWithCircuitBreaker( initParameters: circuitBreakerParameters, executeParameters: circuitBreakerParameters, subscribeRetryInterval: TimeSpan.FromMilliseconds(1), exceptionFilter: exception => exception is InvalidOperationException); });
public static IEasyCachingProvider CreateDecoratedProvider( Func <IEasyCachingProvider> providerFactory, IEasyCachingProvider fallbackProvider) => ServiceBuilders.CreateFakeProvider(options => { options.ProviderFactory = providerFactory; var circuitBreakerParameters = new CircuitBreakerParameters( exceptionsAllowedBeforeBreaking: 1, durationOfBreak: TimeSpan.FromMinutes(1)); options .DecorateWithCircuitBreaker( initParameters: circuitBreakerParameters, executeParameters: circuitBreakerParameters, exception => exception is InvalidOperationException) .DecorateWithFallback( (_, __) => fallbackProvider, exception => exception is InvalidOperationException); });