From 9cbed15d27aa00ea64b669f614e1a9599dfbbead Mon Sep 17 00:00:00 2001 From: Tomek Masternak Date: Wed, 8 Jul 2020 14:07:51 +0200 Subject: [PATCH] using validating model in all places --- .../Administration/QueueCreator.cs | 2 +- .../Administration/QueuePurger.cs | 2 +- .../Administration/SubscriptionManager.cs | 4 ++-- src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NServiceBus.Transport.RabbitMQ/Administration/QueueCreator.cs b/src/NServiceBus.Transport.RabbitMQ/Administration/QueueCreator.cs index 0b42423b0..dc236f061 100644 --- a/src/NServiceBus.Transport.RabbitMQ/Administration/QueueCreator.cs +++ b/src/NServiceBus.Transport.RabbitMQ/Administration/QueueCreator.cs @@ -16,7 +16,7 @@ public QueueCreator(ConnectionFactory connectionFactory, IRoutingTopology routin public Task CreateQueueIfNecessary(QueueBindings queueBindings, string identity) { using (var connection = connectionFactory.CreateAdministrationConnection()) - using (var channel = connection.CreateModel()) + using (var channel = new ModelWithValidation(connection.CreateModel())) { DelayInfrastructure.Build(channel); diff --git a/src/NServiceBus.Transport.RabbitMQ/Administration/QueuePurger.cs b/src/NServiceBus.Transport.RabbitMQ/Administration/QueuePurger.cs index fe03483b8..c922f89f8 100644 --- a/src/NServiceBus.Transport.RabbitMQ/Administration/QueuePurger.cs +++ b/src/NServiceBus.Transport.RabbitMQ/Administration/QueuePurger.cs @@ -12,7 +12,7 @@ public QueuePurger(ConnectionFactory connectionFactory) public void Purge(string queue) { using (var connection = connectionFactory.CreateAdministrationConnection()) - using (var channel = connection.CreateModel()) + using (var channel = new ModelWithValidation(connection.CreateModel())) { channel.QueuePurge(queue); } diff --git a/src/NServiceBus.Transport.RabbitMQ/Administration/SubscriptionManager.cs b/src/NServiceBus.Transport.RabbitMQ/Administration/SubscriptionManager.cs index 221528c93..c0db505b0 100644 --- a/src/NServiceBus.Transport.RabbitMQ/Administration/SubscriptionManager.cs +++ b/src/NServiceBus.Transport.RabbitMQ/Administration/SubscriptionManager.cs @@ -20,7 +20,7 @@ public SubscriptionManager(ConnectionFactory connectionFactory, IRoutingTopology public Task Subscribe(Type eventType, ContextBag context) { using (var connection = connectionFactory.CreateAdministrationConnection()) - using (var channel = connection.CreateModel()) + using (var channel = new ModelWithValidation(connection.CreateModel())) { routingTopology.SetupSubscription(channel, eventType, localQueue); } @@ -31,7 +31,7 @@ public Task Subscribe(Type eventType, ContextBag context) public Task Unsubscribe(Type eventType, ContextBag context) { using (var connection = connectionFactory.CreateAdministrationConnection()) - using (var channel = connection.CreateModel()) + using (var channel = new ModelWithValidation(connection.CreateModel())) { routingTopology.TeardownSubscription(channel, eventType, localQueue); } diff --git a/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs b/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs index 7aaa9c67b..e6cb9ebbc 100644 --- a/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs +++ b/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs @@ -81,7 +81,7 @@ public void Start(PushRuntimeSettings limitations) connection = connectionFactory.CreateConnection($"{settings.InputQueue} MessagePump"); - var channel = connection.CreateModel(); + var channel = new ModelWithValidation(connection.CreateModel()); long prefetchCount;