Skip to content

Commit 02b5230

Browse files
Travis Nickelsbordingabparticular
authored
Update to NServiceBus.RabbitMQ 10.0.0 and use management client (#4755)
* Update the transport manifest * Use alpha version of RabbitMQ transport * Update RabbitMQ manifest example * Check connection string to disable management API * Change lock to semaphoreSlim * Update async/await for createConnection * Cleanup transport method call * Update RabbitMQQuery with managementApiUrl for throughput * Add functionality for RabbitMQ connection string management options * Fix diagnostic log text * Add functionality for management options for direct routing * Allow RabbitMQQuery to access the transport * Update alpha version * Update transport creation with new API surface * Remove connection string parsing * Enable strong naming * Change connection string option to ValidateDeliveryLimit * Make RabbitMQ transport internals visible to RabbitMQ transport tests * Remove disableManagementApi * Update RabbitMQQuery to use the transport management client * Fix text * Update API calls * Remove HttpClient and testing for it * Comment out Vhost property for now * Update transport package * Get code compiling * Remove InternalsVisibleTo * Fix formatting error * First pass cleanup * Update to 10.0.0-beta.1 * Improve how custom connection string settings are set * Change how ManagementClient gets passed in * Wire up settings that apparently have been lost * Use classes from transport * Formatting * Fix text for transport manifest * Fix connection string examples * Remove signing from TestHelper * Remove approval files for deleted tests * Update QueueLengthProvider to use management client * Get RabbitMQQuery tests working * Remove unused parameter from RabbitMQQuery ctor * Get QueueLengthProvider tests working * Make IManagementClientProvider lazy to ensure endpoints have started * Remove old settings * Reorder methods * Make GetPage private * Remove unneeded conversion to RabbitMQBrokerQueueDetails * Remove GetPage * Check for DisableStats in TestConnectionCore * Update to 10.0.0-beta.3 * Migrate RabbitMQ management API settings into connection string * Migrate RabbitMQ management API settings from separate app.config entries into the connection string * Renamed settings related to Licensing component's use of RabbitMQ management API Removed unnecessary LINQ usage when working with DbConnectionStringBuilder in ServiceControlAppConfig * Rename extension method * Improve names * Update to 10.0.0-beta.4 * Update to RTM * Ensure connection string settings are migrated during upgrade * Make customize methods consistent * Update the RabbitMQ prereq prompts * Update wording of prerequisites --------- Co-authored-by: Brandon Ording <[email protected]> Co-authored-by: Andreas Bednarz <[email protected]>
1 parent 5611449 commit 02b5230

File tree

35 files changed

+406
-1038
lines changed

35 files changed

+406
-1038
lines changed

.reposync.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
exclusions:
2-
- src/NServiceBus.snk
1+

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageVersion Include="NServiceBus.Metrics" Version="5.0.1" />
3939
<PackageVersion Include="NServiceBus.Metrics.ServiceControl" Version="5.0.0" />
4040
<PackageVersion Include="NServiceBus.Persistence.NonDurable" Version="2.0.1" />
41-
<PackageVersion Include="NServiceBus.RabbitMQ" Version="9.2.0" />
41+
<PackageVersion Include="NServiceBus.RabbitMQ" Version="10.0.0" />
4242
<PackageVersion Include="NServiceBus.SagaAudit" Version="5.0.2" />
4343
<PackageVersion Include="NServiceBus.Testing" Version="9.0.1" />
4444
<PackageVersion Include="NServiceBus.Transport.AzureServiceBus" Version="5.0.0" />

src/NServiceBus.snk

596 Bytes
Binary file not shown.

src/ServiceControl.Config/Commands/ScmuCommandChecks.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Diagnostics;
5+
using System.Text;
56
using System.Threading.Tasks;
67
using ServiceControl.Config.Framework;
78
using ServiceControlInstaller.Engine;
@@ -21,12 +22,19 @@ protected override async Task<bool> PromptForRabbitMqCheck(bool isUpgrade)
2122
{
2223
var title = isUpgrade ? "UPGRADE WARNING" : "INSTALL WARNING";
2324
var beforeWhat = isUpgrade ? "upgrading" : "installing";
24-
var message = $"ServiceControl version {Constants.CurrentVersion} requires RabbitMQ broker version 3.10.0 or higher. Also, the stream_queue and quorum_queue feature flags must be enabled on the broker. Please confirm your broker meets the minimum requirements before {beforeWhat}.";
2525
var question = "Do you want to proceed?";
2626
var yes = "Yes, my RabbitMQ broker meets the minimum requirements";
2727
var no = "No, cancel the install";
2828

29-
var continueInstall = await windowManager.ShowYesNoDialog(title, message, question, yes, no);
29+
var message = new StringBuilder();
30+
message.AppendLine($"ServiceControl version {Constants.CurrentVersion} requires:");
31+
message.AppendLine("• RabbitMQ broker version 3.10.0 or higher");
32+
message.AppendLine("• The stream_queue and quorum_queue feature flags must be enabled");
33+
message.AppendLine($"• The management plugin API must be enabled and accessible. This might require custom settings to be added to the connection string before {beforeWhat}. See the ServiceControl documentation for details.");
34+
message.AppendLine();
35+
message.AppendLine($"Please confirm your broker meets the minimum requirements before {beforeWhat}.");
36+
37+
var continueInstall = await windowManager.ShowYesNoDialog(title, message.ToString(), question, yes, no);
3038
return continueInstall;
3139
}
3240

src/ServiceControl.Management.PowerShell/Validation/AcknowledgementValues.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
static class AcknowledgementValues
44
{
55
public const string RabbitMQBrokerVersion310 = "RabbitMQBrokerVersion310";
6+
public const string RabbitMQManagementApi = "RabbitMQManagementApi";
67
}
78
}

src/ServiceControl.Management.PowerShell/Validation/PowerShellCommandChecks.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,23 @@ protected override Task NotifyForMissingSystemPrerequisites(string missingPrereq
7171

7272
protected override Task<bool> PromptForRabbitMqCheck(bool isUpgrade)
7373
{
74-
if (acknowledgements.Any(ack => ack.Equals(AcknowledgementValues.RabbitMQBrokerVersion310, StringComparison.OrdinalIgnoreCase)))
74+
if (!acknowledgements.Any(ack => ack.Equals(AcknowledgementValues.RabbitMQBrokerVersion310, StringComparison.OrdinalIgnoreCase)))
7575
{
76-
return Task.FromResult(true);
76+
var terminateMsg = $"ServiceControl version {Constants.CurrentVersion} requires RabbitMQ broker version 3.10.0 or higher. Also, the stream_queue and quorum_queue feature flags must be enabled on the broker. Use -Acknowledgements {AcknowledgementValues.RabbitMQBrokerVersion310} if you are sure your broker meets these requirements.";
77+
78+
Terminate(terminateMsg, "Install Error", ErrorCategory.InvalidArgument);
79+
return Task.FromResult(false);
7780
}
7881

79-
var terminateMsg = $"ServiceControl version {Constants.CurrentVersion} requires RabbitMQ broker version 3.10.0 or higher. Also, the stream_queue and quorum_queue feature flags must be enabled on the broker. Use -Acknowledgements {AcknowledgementValues.RabbitMQBrokerVersion310} if you are sure your broker meets these requirements.";
82+
if (!acknowledgements.Any(ack => ack.Equals(AcknowledgementValues.RabbitMQManagementApi, StringComparison.OrdinalIgnoreCase)))
83+
{
84+
var terminateMsg = $"ServiceControl version {Constants.CurrentVersion} requires that the management plugin API must be enabled and accessible. This might require custom settings to be added to the connection string. See the ServiceControl documentation for details. Use -Acknowledgements {AcknowledgementValues.RabbitMQManagementApi} if you are sure your broker meets these requirements.";
8085

81-
Terminate(terminateMsg, "Install Error", ErrorCategory.InvalidArgument);
82-
return Task.FromResult(false);
86+
Terminate(terminateMsg, "Install Error", ErrorCategory.InvalidArgument);
87+
return Task.FromResult(false);
88+
}
89+
90+
return Task.FromResult(true);
8391
}
8492

8593
protected override Task<bool> PromptToStopRunningInstance(BaseService instance)

src/ServiceControl.Transports.RabbitMQ/ConnectionConfiguration.cs

Lines changed: 0 additions & 286 deletions
This file was deleted.

0 commit comments

Comments
 (0)