From 4203f36b7e5904c4ef222d5db59b000cb2c45472 Mon Sep 17 00:00:00 2001 From: John Simons Date: Fri, 22 Aug 2025 13:37:24 +1000 Subject: [PATCH] Only display instructions for MSMQ This also improves the instructions so it does not confuse users. --- .../Shared/ServiceControlSettings.cs | 7 ++----- src/Particular.LicensingComponent/ThroughputCollector.cs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Particular.LicensingComponent/Shared/ServiceControlSettings.cs b/src/Particular.LicensingComponent/Shared/ServiceControlSettings.cs index ba2406323c..2b54b3f5bf 100644 --- a/src/Particular.LicensingComponent/Shared/ServiceControlSettings.cs +++ b/src/Particular.LicensingComponent/Shared/ServiceControlSettings.cs @@ -10,15 +10,12 @@ public static class ServiceControlSettings public static string ServiceControlThroughputDataQueueSetting = "ServiceControlThroughputDataQueue"; public static string ServiceControlThroughputDataQueue = SettingsReader.Read(ThroughputSettings.SettingsNamespace, ServiceControlThroughputDataQueueSetting, "ServiceControl.ThroughputData"); - static string SCQueue = $"{ThroughputSettings.SettingsNamespace.Root}/{ServiceControlThroughputDataQueueSetting}"; - static string SCQueueDescription = $"Service Control throughput processing queue. This setting must match the equivalent `Monitoring/{ServiceControlThroughputDataQueueSetting}` setting for the Monitoring instance."; - static string MonitoringQueue = $"Monitoring/{ServiceControlThroughputDataQueueSetting}"; - static string MonitoringQueueDescription = $"Queue to send monitoring throughput data to for processing by ServiceControl. This setting must match the equivalent `{ThroughputSettings.SettingsNamespace.Root}/{ServiceControlThroughputDataQueueSetting}` setting for the ServiceControl instance."; + static string MonitoringQueueDescription = $"Queue to send monitoring throughput data to for processing by ServiceControl. This setting only needs to be specified if the Monitoring instance is not hosted in the same machine as the Error instance is running on."; public static List GetServiceControlConnectionSettings() { - return [new ThroughputConnectionSetting(SCQueue, SCQueueDescription)]; + return []; } public static List GetMonitoringConnectionSettings() diff --git a/src/Particular.LicensingComponent/ThroughputCollector.cs b/src/Particular.LicensingComponent/ThroughputCollector.cs index 45a2ecbdb4..f7cc882b28 100644 --- a/src/Particular.LicensingComponent/ThroughputCollector.cs +++ b/src/Particular.LicensingComponent/ThroughputCollector.cs @@ -20,7 +20,7 @@ public async Task GetThroughputConnectionSettingsI var throughputConnectionSettings = new ThroughputConnectionSettings { ServiceControlSettings = ServiceControlSettings.GetServiceControlConnectionSettings(), - MonitoringSettings = ServiceControlSettings.GetMonitoringConnectionSettings(), + MonitoringSettings = throughputSettings.TransportType == "MSMQ" ? ServiceControlSettings.GetMonitoringConnectionSettings() : [], BrokerSettings = throughputQuery?.Settings.Select(pair => new ThroughputConnectionSetting($"{ThroughputSettings.SettingsNamespace.Root}/{pair.Key}", pair.Description)).ToList() ?? [] }; return await Task.FromResult(throughputConnectionSettings);