public void ShouldRetryCommand() { // Given var command = new CommandStub(); var target = new RetryCommandExecutor(new AlwaysRetryPolicyStub(), new ZeroRetrySchedulePolicyStub()); // When target.Execute(command.Execute); // Then Assert.AreEqual(2, command.Count); }
public RabbitMqMessageQueueFactory(RabbitMqSettings settings, ILog log, IRabbitMqMessageQueueConfig config) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (config == null) { throw new ArgumentNullException(nameof(config)); } _defaultExchangeConfig = config.DefaultExchangeConfig; _defaultQueueConfig = config.DefaultQueueConfig; _commandExecutor = new RetryCommandExecutor(config.RetryPolicy, config.RetrySchedulePolicy); _sessionFactory = new RabbitMqSessionFactory(settings.Node, settings.Port); _queueListener = new MessageQueueListener(); }