public AzureServiceBusCloneRecoverabilityProvider(IRetryIntervalStrategy retryStrategy = null, int maxDeliveryCount = 20)
        {
            _completeImmediateRetryPolicy = Policy
                                            .Handle <Exception>()
                                            .RetryAsync(_maxCompletionImmediateRetry);

            _retryStrategy    = retryStrategy != null ? retryStrategy : new DefaultExponentialRetryStrategy();
            _maxDeliveryCount = maxDeliveryCount;
        }
        public AzureServiceBusDeferRecoverabilityProvider(IRetryIntervalStrategy retryStrategy = null)
        {
            _completeImmediateRetryPolicy = Policy
                                            .Handle <Exception>()
                                            .RetryAsync(_maxCompletionImmediateRetry);

            _receiveDeferredImmediateRetryPolicy = Policy
                                                   .Handle <Exception>()
                                                   .RetryAsync(_maxReceiveRetry);
            _retryStrategy = retryStrategy != null ? retryStrategy : new DefaultExponentialRetryStrategy();
        }
Esempio n. 3
0
        public Outbox(OutboxSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("OutboxSettings must not be null");
            }

            if (String.IsNullOrEmpty(settings.SqlConnectionString))
            {
                throw new InvalidOperationException("EFCore Outbox requires a connectionString.  ConnectionString can not be null");
            }
            _dbConnection = new SqlConnectionFactory(settings.SqlConnectionString);

            _retryStrategy = settings.RetryStrategy ?? new DefaultExponentialRetryStrategy();

            this.MaxTries                 = settings.MaxTries;
            this.BatchSize                = settings.BatchSize;
            this.MaxConcurrency           = settings.MaxConcurrency;
            this.DisableTransientDispatch = settings.DisableTransientDispatch;
        }