Skip to content

Conversation

li4wang
Copy link
Contributor

@li4wang li4wang commented Sep 27, 2025

The existing ZooKeeper client architecture relies on StaticHostProvider, which lacks auto service discovery capabilities and must wait for external mechanisms to push server list updates, either through manual configuration changes or reconfig notifications.

This PR provides a HostProvider implementation that performs dynamic service discovery based on DNS SRV record. The following is a summary of the changes:

  1. DnsSrvHostProvider: New HostProvider implementation that performs DNS SRV lookups to discover ZooKeeper servers
  2. HostConnectionManager: Extracted connection management and reconfiguration logic from StaticHostProvider into a reusable component
  3. StaticHostProvider Refactoring: Modified to use HostConnectionManager for consistent connection handling across providers
  4. ConnectionType: New enum that represents the type of connection resolutions
  5. Configuration: Added zookeeper.hostProvider.dnsSrvRefreshIntervalMs client property for DNS refresh intervals

…ynamic server discovery

Author: Li Wang <liwang@apple.com>
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.

1 participant