diff --git a/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs b/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs index 5dde3fcf7..76aed4147 100644 --- a/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs +++ b/src/NServiceBus.Transport.RabbitMQ/Receiving/MessagePump.cs @@ -275,16 +275,15 @@ async Task Reconnect(CancellationToken cancellationToken) connection.Dispose(); - Logger.InfoFormat("'{0}': Attempting to reconnect in {1} seconds.", name, retryDelay.TotalSeconds); - - await Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); - ConnectToBroker(); break; } catch (Exception ex) when (!ex.IsCausedBy(cancellationToken)) { Logger.InfoFormat("'{0}': Reconnecting to the broker failed: {1}", name, ex); + + Logger.InfoFormat("'{0}': Attempting to reconnect in {1} seconds.", name, retryDelay.TotalSeconds); + await Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); } }