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

RabbitMQ 4.0 support #1512

wants to merge 46 commits into from

Conversation

abparticular
Copy link
Contributor

No description provided.

abparticular and others added 30 commits November 28, 2024 08:20
Pass ManagementClient through to MessagePump
Fix Queue model definition
Determine whether policy override of delivery limit is supported by the broker version
@@ -0,0 +1,182 @@
#nullable enable

namespace NServiceBus.Transport.RabbitMQ.Administration;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
namespace NServiceBus.Transport.RabbitMQ.Administration;
namespace NServiceBus.Transport.RabbitMQ;

using System.Threading.Tasks;
using System.Threading;

interface IBrokerVerifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the benefit in having this interface. Is there a specific reason to have it?

@@ -0,0 +1,34 @@
#nullable enable

namespace NServiceBus.Transport.RabbitMQ.Administration.ManagementClient.Converters;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change all of the management client namespaces to

Suggested change
namespace NServiceBus.Transport.RabbitMQ.Administration.ManagementClient.Converters;
namespace NServiceBus.Transport.RabbitMQ.ManagementClient;

using System.Threading.Tasks;
using NServiceBus.Transport.RabbitMQ.Administration.ManagementClient.Models;

interface IManagementClient
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this interface?


namespace NServiceBus.Transport.RabbitMQ.Administration.ManagementClient;

interface IManagementClientFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question, why the interface?

@@ -0,0 +1,15 @@
namespace NServiceBus.Transport.RabbitMQ.Administration.ManagementClient.Models;

/// <summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about xml comments.

@@ -9,8 +9,10 @@
class ConnectionConfiguration
{
const bool defaultUseTls = false;
const int defaultPort = 5672;
const int defaultTlsPort = 5671;
const int defaultBrokerPort = 5672;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think any of the changes in this file should be done. Instead, the management client should just take a regular ConnectionConfiguration instance. The knowledge of needing to override the ports for the management client should be there instead.

@@ -96,6 +96,36 @@ public static TransportExtensions<RabbitMQTransport> ConnectionString(this Trans
return transportExtensions;
}

/// <summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like also need a way to disable the management client usage through the legacy config API.


ManagementConnectionConfiguration = string.IsNullOrEmpty(managementConnectionString) ?
ConnectionConfiguration.ConvertToManagementConnection(BrokerConnectionConfiguration) :
ConnectionConfiguration.Create(managementConnectionString, isManagementConnection: true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah my comment about not using ConnectionConfiguration above... yeah that needs to change.

The management client connection string is going to be an http/s URL, which isn't something ConnectionConfiguration knows how to parse, so we should never be trying to pass that in.

ConnectionConfiguration is for parsing our own made up connection string format and the amqp format that the client understands.

/// <param name="enableDelayedDelivery">Should the delayed delivery infrastructure be created by the endpoint</param>
public RabbitMQTransport(RoutingTopology routingTopology, string connectionString, bool enableDelayedDelivery)
public RabbitMQTransport(RoutingTopology routingTopology, string connectionString, bool enableDelayedDelivery, string managementConnectionString = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not use optional parameters in public APIs. They can be hard to version properly. Instead, we should add overloads that take the management connection string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants