Skip to content

Commit f30fa15

Browse files
committed
Get code compiling
1 parent 5114716 commit f30fa15

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ServiceControl.Transports.RabbitMQ/RabbitMQQuery.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ namespace ServiceControl.Transports.RabbitMQ;
1212
using System.Threading.Tasks;
1313
using Microsoft.Extensions.Logging;
1414
using NServiceBus;
15+
using NServiceBus.Transport.RabbitMQ.ManagementApi;
1516
using Polly;
1617
using Polly.Retry;
1718
using ServiceControl.Transports.BrokerThroughput;
18-
using NServiceBus.Transport.RabbitMQ.ManagementApi;
1919

2020
public class RabbitMQQuery : BrokerThroughputQuery
2121
{
22-
HttpClient? httpClient;
2322
readonly ResiliencePipeline pipeline = new ResiliencePipelineBuilder()
2423
.AddRetry(new RetryStrategyOptions()) // Add retry using the default options
2524
.AddTimeout(TimeSpan.FromMinutes(2)) // Add timeout if it keeps failing
@@ -93,7 +92,7 @@ public override async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBro
9392
//logger.LogDebug($"Querying {url}");
9493
response = await pipeline.ExecuteAsync(async token => await rabbitMQTransport.ManagementClient.GetQueue(queue.QueueName, cancellationToken), cancellationToken);
9594

96-
if (response.Value is not null)
95+
if (response.Value is null)
9796
{
9897
throw new InvalidOperationException($"Could not access RabbitMQ Management API. ({response.StatusCode}: {response.Reason})");
9998
}
@@ -251,7 +250,7 @@ static List<RabbitMQBrokerQueueDetails> MaterializeQueueDetails(List<Queue> item
251250
}
252251
catch (HttpRequestException e)
253252
{
254-
throw new Exception($"Failed to connect to '{httpClient!.BaseAddress}'", e);
253+
throw new Exception($"Failed to connect to management API", e);
255254
}
256255

257256
return (true, []);

0 commit comments

Comments
 (0)