public EasyNetQSubscriberFactory(IBroker broker, string exchangename, string waitexchangename, ISubscriberController subscriberController, IEnvironmentNamingConventionController environmentNamingConventionController, int retryfactor, IPublisher publisher) { _broker = broker; _bus = broker.Bus; _subscriberController = subscriberController; _exchange = new AsyncLazy <IExchange>(async() => await _bus.ExchangeDeclareAsync(exchangename, ExchangeType.Topic)); _easyNetQPublisherToWaitExchange = new EasyNetQPublisher(_bus, waitexchangename, environmentNamingConventionController); _environmentNamingConventionController = environmentNamingConventionController; _retryfactor = retryfactor; _publisher = publisher; }
public ExecutionHandlingStrategy(string name, EasyNetQPublisher waitEasyNetQPublisher, int maxRetry, IModelNamingConventionController modelNamingConventionController, bool explicitAcknowledgments, IPublisher publisher, bool storedeadletter) { _name = name; _waitEasyNetQPublisher = waitEasyNetQPublisher; _maxRetry = maxRetry; _modelNamingConventionController = modelNamingConventionController; _publisher = publisher; _storedeadletter = storedeadletter; if (explicitAcknowledgments) { _successExecutionHandler = HandleTrackingAsync; _failedExecutionHandler = HandleDeadletterQueueAndTrackingAsync; } else { _failedExecutionHandler = HandleDeadletterQueueWithoutTrackingAsync; } }