rabbitmq / rabbitmq-amqp-dotnet-client

RabbitMQ client for AMQP 1.0 protocol
Other
11 stars 2 forks source link

Support/guidance for multiple hosts #92

Open SemaphoreSlim1 opened 1 week ago

SemaphoreSlim1 commented 1 week ago

Is your feature request related to a problem? Please describe.

When configuring RabbitMQ server to run in a quorum, it is common that the nodes are hosted on more than one host.

The RabbitMq.Client library supports failover to these other nodes by accepting a list of endpoints when creating the connection from the connection factory.

It doesn't seem like this client supports this feature

Describe the solution you'd like

As a user of this library, and with no idea how difficult this would be to implement...I'd like to propose the following change:

Instead of calling .Host(...) on ConnectionSettingBuilder, I would call .AddHost(...)

My code would then look like this:

ConnectionSettingBuilder.Create()
                        .AddHost("localhost") //primary node
                        .AddHost("localhost2") //node 2
                        .AddHost("localhost3") //node 3

When failing over from the primary node to another node, I would expect the underlying connection to transition in the following fashion: Open -> Reconnecting -> Open

Describe alternatives you've considered

No response

Additional context

If this feature is already part of this library, or is inappropriate for the 1.0 protocol, please disregard and provide a transition guideline from the existing supported feature of the 0.9.1 AMQP client library

Gsantomaggio commented 1 week ago

@SemaphoreSlim1 Thank you for raising the issue.

I think that we should accept more endpoints by default like we do in the stream client, WDYT @lukebakken