Skip to content

Implement DnsAddressResolver and ResolveAsync for DNS Load Balanced clusters - #466

Merged
Gsantomaggio merged 5 commits into
rabbitmq:mainfrom
lukas8219:dns-address-resolver
May 28, 2026
Merged

Implement DnsAddressResolver and ResolveAsync for DNS Load Balanced clusters#466
Gsantomaggio merged 5 commits into
rabbitmq:mainfrom
lukas8219:dns-address-resolver

Conversation

@lukas8219

Copy link
Copy Markdown
Contributor

Closes #454

What

Implements new methods to handle client-side load balancing for DNS load balanced clusters, fixing scenarios of retry exhaustion.

@lukas8219 lukas8219 changed the title Implement DnsAddressResolver and ResolveAsync for DNS Load Balancer clusters Implement DnsAddressResolver and ResolveAsync for DNS Load Balanced clusters May 21, 2026
@Gsantomaggio

Copy link
Copy Markdown
Member

Thanks for your contribution. @lukas8219
To move forward with the PR, you should sign a CLA.
You can find the process here: https://github.com/rabbitmq/cla

@lukas8219

Copy link
Copy Markdown
Contributor Author

@Gsantomaggio Ok! Just waiting for the reply


{
logger?.LogDebug(
endPoint = await clientParameters.AddressResolver.ResolveAsync(broker.Host, (int)broker.Port).ConfigureAwait(false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did you add this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea is to have the load balanced implemented on client-side. Here you can see it iterates over the entries. So each call for ResolveAsync would return a different entry.

@lukas8219 lukas8219 May 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All calls to Dns.GetHostEntryAsync return the same list. The Endpoint being returned on the default approach using Reverse Proxies (where IP doesn't change or doesn't mean anything) it would be constantly hitting the same entry over and over.

@Gsantomaggio

Copy link
Copy Markdown
Member

Thank you @lukas8219,
I will review it as soon as possible I am busy in something else. Can you please fix the formatting code? make format should be enough.

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio self-assigned this May 28, 2026
@Gsantomaggio Gsantomaggio added enhancement New feature or request breaking-change introduce breaking-change and removed breaking-change introduce breaking-change labels May 28, 2026
@Gsantomaggio Gsantomaggio added this to the 1.12 milestone May 28, 2026
@Gsantomaggio Gsantomaggio added the deprecation introduce deprecation label May 28, 2026
Gsantomaggio
Gsantomaggio previously approved these changes May 28, 2026
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio
Gsantomaggio merged commit ab11db5 into rabbitmq:main May 28, 2026
@Gsantomaggio

Copy link
Copy Markdown
Member

@lukas8219 Thank you

@lukas8219

Copy link
Copy Markdown
Contributor Author

Sorry not linting it in time @Gsantomaggio !!I missed the first notification! 🤦‍♂️

Thanks for accepting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation introduce deprecation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement simple DNS Round Robin Load Balancing

2 participants