public void settings_that_are_changed_are_also_changed_in_queue_manager() { var settings = new LightningQueueSettings { EnableOutgoingMessageHistory = false, EnableProcessedMessageHistory = false, NumberOfMessagesToKeepInOutgoingHistory = 1, NumberOfMessagesToKeepInProcessedHistory = 2, NumberOfReceivedMessageIdsToKeep = 3, OldestMessageInOutgoingHistory = TimeSpan.FromSeconds(1), OldestMessageInProcessedHistory = TimeSpan.FromSeconds(1), }; using (var queues = new PersistentQueues(new RecordingLogger(), new DelayedMessageCache <MessageId>(), settings)) { queues.ClearAll(); queues.Start(new[] { new LightningUri("lq.tcp://localhost:2424/some_queue") }); var queueManager = queues.ManagerFor(2424, true); var actual = queueManager.Configuration; actual.EnableOutgoingMessageHistory.ShouldEqual(settings.EnableOutgoingMessageHistory); actual.EnableProcessedMessageHistory.ShouldEqual(settings.EnableProcessedMessageHistory); actual.NumberOfMessagesToKeepInOutgoingHistory.ShouldEqual(settings.NumberOfMessagesToKeepInOutgoingHistory); actual.NumberOfMessagesToKeepInProcessedHistory.ShouldEqual(settings.NumberOfMessagesToKeepInProcessedHistory); actual.NumberOfReceivedMessageIdsToKeep.ShouldEqual(settings.NumberOfReceivedMessageIdsToKeep); actual.OldestMessageInOutgoingHistory.ShouldEqual(settings.OldestMessageInOutgoingHistory); actual.OldestMessageInProcessedHistory.ShouldEqual(settings.OldestMessageInProcessedHistory); } }
protected override void beforeEach() { theSettings = new LightningQueueSettings(); Services.Inject(theSettings); }
public void settings_that_are_changed_are_also_changed_in_queue_manager() { var settings = new LightningQueueSettings { EnableOutgoingMessageHistory = false, EnableProcessedMessageHistory = false, NumberOfMessagesToKeepInOutgoingHistory = 1, NumberOfMessagesToKeepInProcessedHistory = 2, NumberOfReceivedMessageIdsToKeep = 3, OldestMessageInOutgoingHistory = TimeSpan.FromSeconds(1), OldestMessageInProcessedHistory = TimeSpan.FromSeconds(1), }; using (var queues = new PersistentQueues(new RecordingLogger(), new DelayedMessageCache<MessageId>(), settings)) { queues.ClearAll(); queues.Start(new[] { new LightningUri("lq.tcp://localhost:2424/some_queue") }); var queueManager = queues.ManagerFor(2424, true); var actual = queueManager.Configuration; actual.EnableOutgoingMessageHistory.ShouldEqual(settings.EnableOutgoingMessageHistory); actual.EnableProcessedMessageHistory.ShouldEqual(settings.EnableProcessedMessageHistory); actual.NumberOfMessagesToKeepInOutgoingHistory.ShouldEqual(settings.NumberOfMessagesToKeepInOutgoingHistory); actual.NumberOfMessagesToKeepInProcessedHistory.ShouldEqual(settings.NumberOfMessagesToKeepInProcessedHistory); actual.NumberOfReceivedMessageIdsToKeep.ShouldEqual(settings.NumberOfReceivedMessageIdsToKeep); actual.OldestMessageInOutgoingHistory.ShouldEqual(settings.OldestMessageInOutgoingHistory); actual.OldestMessageInProcessedHistory.ShouldEqual(settings.OldestMessageInProcessedHistory); } }