Exemple #1
0
        private IEasyCachingBus CreateDecoratedProvider() =>
        ServiceBuilders.CreateFakeBus(options =>
        {
            options.BusFactory = CreateBus;

            options.DecorateWithPublishFallback(
                exceptionFilter: exception => exception is InvalidOperationException);
        });
Exemple #2
0
        private IEasyCachingBus CreateDecoratedProvider() =>
        ServiceBuilders.CreateFakeBus(options =>
        {
            options.BusFactory = CreateBus;

            options.DecorateWithRetry(
                retryCount: 1,
                exceptionFilter: exception => exception is InvalidOperationException);
        });
Exemple #3
0
        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);
        });