Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ 4.0 support #1512

Draft
wants to merge 46 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c4e288f
Add very basic client for Management API
abparticular Oct 30, 2024
4258851
Use default port for management API
abparticular Oct 31, 2024
a207206
Add policy related models for Management API
abparticular Oct 31, 2024
7f4fa07
Added Management Client method for getting Management API overview
abparticular Nov 1, 2024
5f5deb2
Update exception messages changes from RabbitMQ 4.0
TravisNickels Nov 1, 2024
90a394f
Determine whether access to management API is available
abparticular Nov 1, 2024
6164a9b
Add ability to create policies and query queue arguments through Rabb…
abparticular Nov 6, 2024
fffd39c
Rename and move management client to Administration folder
TravisNickels Nov 3, 2024
ebe44d2
Add test for getting queue information from management client
TravisNickels Nov 3, 2024
94955b2
Trying to remove the Fody errors
TravisNickels Nov 3, 2024
d60388d
Remove required fields on the queue model
TravisNickels Nov 3, 2024
20fa512
Simplify management API test for creating quorum queue
TravisNickels Nov 5, 2024
815108c
Add another management API test
TravisNickels Nov 5, 2024
28957a5
Suppress Fody obsolete usage error
TravisNickels Nov 5, 2024
34bff94
Move QueueArguments to the correct namespace
abparticular Nov 6, 2024
27fbf29
Add the escaped virtual host to the PUT method
TravisNickels Nov 6, 2024
ba7d249
Wider allowed version range in Get Management Overview test
abparticular Nov 6, 2024
90ba42a
Rename IManagementApi
abparticular Nov 6, 2024
e1bff5f
Extract broker verification into its own class
abparticular Nov 6, 2024
99b6855
Added retry policy when getting queue details from Management API to …
abparticular Nov 6, 2024
18804a9
Make QueueArguments.QueueType optional/nullable
abparticular Nov 6, 2024
3772929
Add configuration option to prevent the transport using the RabbitMQ …
abparticular Nov 27, 2024
3b0085f
Add functionality to set management client setting
TravisNickels Nov 9, 2024
c329db9
Add management connection string API
TravisNickels Dec 5, 2024
43e6c23
Remove X509 management certificate
TravisNickels Dec 5, 2024
65df787
Add and update ConnectionConfiguration tests
TravisNickels Dec 5, 2024
f9d7b63
Update ManagementConnection tests to use a separate managementConnect…
TravisNickels Dec 5, 2024
39f88f1
Refactor null checks
TravisNickels Dec 6, 2024
af8e042
Check if management client has been disabled
TravisNickels Dec 6, 2024
5753e11
Remove Cert checks
TravisNickels Dec 6, 2024
68bacf1
Update rabbitmq setup action
TravisNickels Dec 7, 2024
3251ca4
Refactor ConnectionConfiguration
TravisNickels Dec 7, 2024
549d395
Add a fake connection configuration for tests
TravisNickels Dec 7, 2024
e2c3cb2
Update the exception tests for invalid connection strings
TravisNickels Dec 7, 2024
e559fed
Remove unnecessary escaping of a Policy's VirtualHost property
abparticular Dec 10, 2024
b0fb724
Minor changes
abparticular Dec 5, 2024
12f3698
Move ManagementClient tests
abparticular Dec 5, 2024
5ae951e
Refactor ManagementClient tests and add tests for getting feature fla…
abparticular Dec 6, 2024
7a5e642
Simplified some connection configuration tests that use the transport
abparticular Dec 6, 2024
032fc1c
Use RabbitMQ v4 for testing
abparticular Dec 11, 2024
d39c658
Removed IBrokerVerifier interface
abparticular Dec 18, 2024
9ed7760
Removed IManagementClient
abparticular Dec 18, 2024
e679089
Remove ManagementClientFactory
abparticular Dec 18, 2024
8e1986a
Removed XML comments
abparticular Dec 18, 2024
5b4c73d
Converted optional parameter in RabbitMQTransport constructor to an o…
abparticular Dec 18, 2024
d02581d
Fix approval test
abparticular Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ jobs:
creds: ${{ secrets.AZURE_ACI_CREDENTIALS }}
enable-AzPSSession: true
- name: Setup RabbitMQ
uses: Particular/[email protected].0
uses: Particular/[email protected].1
with:
connection-string-name: RabbitMQTransport_ConnectionString
tag: RabbitMQTransport
image-tag: 4-management
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public async Task Should_fail_to_start()
.Run());

Assert.That(exception.Message, Does.Contain("PRECONDITION_FAILED - inequivalent arg 'x-queue-type' for queue 'rabbitmq.transport.tests.quorum-error'"));
Assert.That(exception.Message, Does.Contain("received none but current is the value 'quorum'"));
Assert.That(exception.Message, Does.Contain("received none but current is the value 'quorum'") // RabbitMQ v3.x
.Or.Contain("received 'classic' but current is 'quorum'")); // RabbitMQ v4.x
}

class ClassicQueueEndpoint : EndpointConfigurationBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public async Task Should_fail_to_start()
.Run());

Assert.That(exception.Message, Does.Contain("PRECONDITION_FAILED - inequivalent arg 'x-queue-type' for queue 'ClassicEndpointUsesQuorumQueue.ClassicQueueEndpoint'"));
Assert.That(exception.Message, Does.Contain("received none but current is the value 'quorum'"));
Assert.That(exception.Message, Does.Contain("received none but current is the value 'quorum'") // RabbitMQ v3.x
.Or.Contain("received 'classic' but current is 'quorum'")); // RabbitMQ v4.x
}

class ClassicQueueEndpoint : EndpointConfigurationBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public async Task Should_fail_to_start()
.Run());

Assert.That(exception.Message, Does.Contain("PRECONDITION_FAILED - inequivalent arg 'x-queue-type' for queue 'rabbitmq.transport.tests.classic-error'"));
Assert.That(exception.Message, Does.Contain("received the value 'quorum' of type 'longstr' but current is none'"));
Assert.That(exception.Message, Does.Contain("received the value 'quorum' of type 'longstr' but current is none'") // RabbitMQ v3.x
.Or.Contain("received 'quorum' but current is 'classic'")); // RabbitMQ v4.x
}

class QuorumQueueEndpoint : EndpointConfigurationBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public async Task Should_fail_to_start()
.Run());

Assert.That(exception.Message, Does.Contain("PRECONDITION_FAILED - inequivalent arg 'x-queue-type' for queue 'QuorumEndpointUsesClassicQueue.QuorumQueueEndpoint'"));
Assert.That(exception.Message, Does.Contain("received the value 'quorum' of type 'longstr' but current is none"));
Assert.That(exception.Message, Does.Contain("received the value 'quorum' of type 'longstr' but current is none'") // RabbitMQ v3.x
.Or.Contain("received 'quorum' but current is 'classic'")); // RabbitMQ v4.x
}

class QuorumQueueEndpoint : EndpointConfigurationBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override BrokerConnection GetBoundValue(BindingContext bindingContext)
return brokerConnection;
}

string GetConnectionString(string? connectionString, string? connectionStringEnv)
static string GetConnectionString(string? connectionString, string? connectionStringEnv)
{
if (string.IsNullOrWhiteSpace(connectionString))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ namespace NServiceBus
{
public RabbitMQTransport(NServiceBus.RoutingTopology routingTopology, string connectionString) { }
public RabbitMQTransport(NServiceBus.RoutingTopology routingTopology, string connectionString, bool enableDelayedDelivery) { }
public RabbitMQTransport(NServiceBus.RoutingTopology routingTopology, string connectionString, string managementConnectionString) { }
public RabbitMQTransport(NServiceBus.RoutingTopology routingTopology, string connectionString, bool enableDelayedDelivery, string managementConnectionString) { }
public System.Security.Cryptography.X509Certificates.X509Certificate2 ClientCertificate { get; set; }
public bool DoNotUseManagementClient { get; set; }
public System.TimeSpan HeartbeatInterval { get; set; }
public System.Func<RabbitMQ.Client.Events.BasicDeliverEventArgs, string> MessageIdStrategy { get; set; }
public System.TimeSpan NetworkRecoveryInterval { get; set; }
Expand All @@ -41,6 +44,8 @@ namespace NServiceBus
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> CustomMessageIdStrategy(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.Func<RabbitMQ.Client.Events.BasicDeliverEventArgs, string> customIdStrategy) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> DisableDurableExchangesAndQueues(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> DisableRemoteCertificateValidation(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> ManagementConnectionString(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.Func<string> getConnectionString) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> ManagementConnectionString(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, string connectionString) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> PrefetchCount(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, ushort prefetchCount) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> PrefetchMultiplier(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, int prefetchMultiplier) { }
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> SetClientCertificate(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate) { }
Expand Down
Loading