-
Notifications
You must be signed in to change notification settings - Fork 605
Allow IHostanameSelector to return a dynamically resolved hostname #195
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
Comments
Hi @alessnet - can you please direct your question to the rabbitmq-users mailing list. We use github issues for actionable items only. Cheers. |
The action item here would be to add this functionality if missing, or clarify the documentation if this is possible using the existing IHostnameSelector. Sorry for the inconvenience |
Ok from looking at the code it looks like having IHostnameSelector returning an arbitrary endpoint might have worked in the past but won't work with the current version. So the feature request is to somehow allow users to specify an arbitrary endpoint resolution strategy? |
|
I suggest we add an IEndpointSelector with |
We can do that but it's not the point of this issue. This issue is about producing a list of endpoints or hostnames dynamically. |
The new interface would allow you to return an arbitrarily resolved endpoint, say, resolved from round-robin dns but perhaps it isn't a particularly intuitive interface as you'd have to ignore the endpoints provided to |
I'm going to start implementation of this for v4. As we can impose some smaller breaking changes I suggest we change |
Created PR for this now which introduces the Here is a simple untested example of an
|
Hello,
I'm using a service-discovery which gives me the latest list of addresses for Rabbitmq servers (and which ones are in the same datacenter). So the addresses are not hard-coded in the client configuration. The list is dynamic and can change when servers goes down or up.
The issue with the current rabbit client if that we have to give a static list of hosts when creating the connection. When the connection is lost, we can specify the new host using IHostnameSelector. But we may want to return an host that was not originally in the list (because the could have changed in the meantime, especially if this is a long running process).
So in IHostnameSelector.NextFrom(list), is it ok to return an host name that was not in the original list ?
If not, how could we provide a new list when a recovery occurs, without recreating the whole connection?
Thank you
The text was updated successfully, but these errors were encountered: