Skip to content

Commit 2c015b2

Browse files
Travis Nickelsbording
authored andcommitted
Comment out Vhost property for now
1 parent 66a908a commit 2c015b2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/ServiceControl.Transports.RabbitMQ/RabbitMQBrokerQueueDetails.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class RabbitMQBrokerQueueDetails(Queue queue) : IBrokerQueue
99
{
1010
public string QueueName { get; } = queue.Name;
1111
public string SanitizedName => QueueName;
12-
public string Scope => VHost;
13-
public string VHost { get; } = queue.Vhost;
12+
public string? Scope => null;
13+
//public string VHost { get; } = queue.Vhost;
1414
public List<string> EndpointIndicators { get; } = [];
1515
long? AckedMessages { get; set; } = queue.MessageStats?.Ack;
1616
long Baseline { get; set; } = queue.MessageStats?.Ack ?? 0;

src/ServiceControl.Transports.RabbitMQ/RabbitMQQuery.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ namespace ServiceControl.Transports.RabbitMQ;
1010
using System.Runtime.CompilerServices;
1111
using System.Threading;
1212
using System.Threading.Tasks;
13-
using System.Web;
1413
using Microsoft.Extensions.Logging;
1514
using NServiceBus;
1615
using Polly;
@@ -72,9 +71,9 @@ public override async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBro
7271
[EnumeratorCancellation] CancellationToken cancellationToken = default)
7372
{
7473
var queue = (RabbitMQBrokerQueueDetails)brokerQueue;
75-
var url = $"/api/queues/{HttpUtility.UrlEncode(queue.VHost)}/{HttpUtility.UrlEncode(queue.QueueName)}";
74+
//var url = $"/api/queues/{HttpUtility.UrlEncode(queue.VHost)}/{HttpUtility.UrlEncode(queue.QueueName)}";
7675

77-
logger.LogDebug($"Querying {url}");
76+
//logger.LogDebug($"Querying {url}");
7877

7978
var response = await pipeline.ExecuteAsync(async token => await rabbitMQTransport.ManagementClient.GetQueue(queue.QueueName, cancellationToken), cancellationToken);
8079

@@ -91,7 +90,7 @@ public override async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBro
9190
for (var i = 0; i < 24 * 4; i++)
9291
{
9392
await Task.Delay(TimeSpan.FromMinutes(15), timeProvider, cancellationToken);
94-
logger.LogDebug($"Querying {url}");
93+
//logger.LogDebug($"Querying {url}");
9594
response = await pipeline.ExecuteAsync(async token => await rabbitMQTransport.ManagementClient.GetQueue(queue.QueueName, cancellationToken), cancellationToken);
9695

9796
if (response.Value is not null)
@@ -144,7 +143,7 @@ public override async IAsyncEnumerable<IBrokerQueue> GetQueueNames([EnumeratorCa
144143
{
145144
var page = 1;
146145
bool morePages;
147-
var vHosts = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
146+
//var vHosts = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
148147

149148
await GetRabbitDetails(false, cancellationToken);
150149

@@ -162,7 +161,7 @@ public override async IAsyncEnumerable<IBrokerQueue> GetQueueNames([EnumeratorCa
162161
{
163162
continue;
164163
}
165-
vHosts.Add(rabbitMQQueueDetails.VHost);
164+
//vHosts.Add(rabbitMQQueueDetails.VHost);
166165
await AddAdditionalQueueDetails(rabbitMQQueueDetails, cancellationToken);
167166
yield return rabbitMQQueueDetails;
168167
}
@@ -171,7 +170,7 @@ public override async IAsyncEnumerable<IBrokerQueue> GetQueueNames([EnumeratorCa
171170
page++;
172171
} while (morePages);
173172

174-
ScopeType = vHosts.Count > 1 ? "VirtualHost" : null;
173+
//ScopeType = vHosts.Count > 1 ? "VirtualHost" : null;
175174
}
176175

177176
async Task AddAdditionalQueueDetails(RabbitMQBrokerQueueDetails brokerQueue, CancellationToken cancellationToken)
@@ -182,7 +181,7 @@ async Task AddAdditionalQueueDetails(RabbitMQBrokerQueueDetails brokerQueue, Can
182181

183182
// Check if conventional binding is found
184183
if (response.Value.Any(binding => binding?.Source == brokerQueue.QueueName
185-
&& binding?.Vhost == brokerQueue.VHost
184+
//&& binding?.Vhost == brokerQueue.VHost
186185
&& binding?.Destination == brokerQueue.QueueName
187186
&& binding?.DestinationType == "queue"
188187
&& binding?.RoutingKey == string.Empty
@@ -202,7 +201,7 @@ async Task AddAdditionalQueueDetails(RabbitMQBrokerQueueDetails brokerQueue, Can
202201

203202
// Check if delayed binding is found
204203
if (response.Value.Any(binding => binding?.Source is "nsb.v2.delay-delivery" or "nsb.delay-delivery"
205-
&& binding?.Vhost == brokerQueue.VHost
204+
//&& binding?.Vhost == brokerQueue.VHost
206205
&& binding?.Destination == brokerQueue.QueueName
207206
&& binding?.DestinationType == "exchange"
208207
&& binding?.RoutingKey == $"#.{brokerQueue.QueueName}"))

0 commit comments

Comments
 (0)