コード例 #1
0
 /// <summary>
 /// Constructs the step, using the given error tracker
 /// </summary>
 public FailFastStep(IErrorTracker errorTracker, IFailFastChecker failFastChecker, IErrorHandler errorHandler, ITransport transport)
 {
     _errorTracker    = errorTracker ?? throw new ArgumentNullException(nameof(errorTracker));
     _failFastChecker = failFastChecker ?? throw new ArgumentNullException(nameof(failFastChecker));
     _errorHandler    = errorHandler ?? throw new ArgumentNullException(nameof(errorHandler));
     _transport       = transport ?? throw new ArgumentNullException(nameof(transport));
 }
コード例 #2
0
        void InitializeBus(int numberOfRetries, IFailFastChecker failFastChecker = null)
        {
            _network = new InMemNetwork();

            _handlerActivator = new BuiltinHandlerActivator();

            _bus = Configure.With(_handlerActivator)
                   .Logging(l => l.Console(minLevel: LogLevel.Warn))
                   .Transport(t => t.UseInMemoryTransport(_network, InputQueueName))
                   .Routing(r => r.TypeBased().Map <string>(InputQueueName))
                   .Options(o =>
            {
                o.SetNumberOfWorkers(1);
                o.SetMaxParallelism(1);

                o.SimpleRetryStrategy(maxDeliveryAttempts: numberOfRetries, errorQueueAddress: ErrorQueueName);

                if (failFastChecker != null)
                {
                    o.Register(_ => failFastChecker);
                }
            })
                   .Start();

            Using(_bus);
        }
コード例 #3
0
 /// <summary>
 /// Constructs the retry strategy with the given settings, creating an error queue with the configured name if necessary
 /// </summary>
 public ArkRetryStrategy(SimpleRetryStrategySettings simpleRetryStrategySettings, IRebusLoggerFactory rebusLoggerFactory, IErrorTracker errorTracker, IErrorHandler errorHandler, IFailFastChecker failFastChecker, CancellationToken cancellationToken)
 {
     _simpleRetryStrategySettings = simpleRetryStrategySettings ?? throw new ArgumentNullException(nameof(simpleRetryStrategySettings));
     _rebusLoggerFactory          = rebusLoggerFactory ?? throw new ArgumentNullException(nameof(rebusLoggerFactory));
     _errorTracker      = errorTracker ?? throw new ArgumentNullException(nameof(errorTracker));
     _errorHandler      = errorHandler ?? throw new ArgumentNullException(nameof(errorHandler));
     _failFastChecker   = failFastChecker;
     _cancellationToken = cancellationToken;
 }
コード例 #4
0
 public MyFailFastChecker(IFailFastChecker failFastChecker)
 {
     _failFastChecker = failFastChecker;
 }
コード例 #5
0
ファイル: FailFastStep.cs プロジェクト: yourFinger/Rebus
 /// <summary>
 /// Constructs the step, using the given error tracker
 /// </summary>
 public FailFastStep(IErrorTracker errorTracker, IFailFastChecker failFastChecker)
 {
     _errorTracker    = errorTracker ?? throw new ArgumentNullException(nameof(errorTracker));
     _failFastChecker = failFastChecker ?? throw new ArgumentNullException(nameof(failFastChecker));
 }
コード例 #6
0
 public FailFastOnSpecificExceptionTypeAndPredicate(IFailFastChecker failFastChecker, Func <TException, bool> predicate = null)
 {
     _failFastChecker = failFastChecker ?? throw new ArgumentNullException(nameof(failFastChecker));
     _predicate       = predicate ?? (_ => true);
 }