/// <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)); }
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); }
/// <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; }
public MyFailFastChecker(IFailFastChecker failFastChecker) { _failFastChecker = failFastChecker; }
/// <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)); }
public FailFastOnSpecificExceptionTypeAndPredicate(IFailFastChecker failFastChecker, Func <TException, bool> predicate = null) { _failFastChecker = failFastChecker ?? throw new ArgumentNullException(nameof(failFastChecker)); _predicate = predicate ?? (_ => true); }