+1, LGTM When configuring the `dnsServerAddresses`, we can configure the custom DNS Servers for the Pulsar client in the program.
Thanks, Zixuan Diego Salvi <lothruin.mir...@gmail.com> 于2023年10月12日周四 23:00写道: > > Hi Pulsar Community, > > This is a PIP discussion on how support custom DNSes configuration to be > used by the Pulsar Client. > > This is the PIP issue https://github.com/apache/pulsar/pull/21352 > > # Motivation > > Currently Pulsar client levereage on JVM detected DNSes or on Google DNSes > if nothing was found (as per Netty default). You cannot change which DNSes > use to resolve hostnames but you are forced to use local server one (like > DNSes configured through resolv.conf or similar ways) or leverage on some > Netty "black magic" system properties. > > The ability to directly configure which DNSes use is strictly necessary in > environment with "specialized" DNSes. > > # Goals > > ## In Scope > > Add a new configuration on Pulsar client to explicitly set which DNSes use. > > ## Out of Scope > > Fully configure DNS layer, properties, timeouts etcetera. > > > # High Level Design > > A new client configuration will be added to list wich DNSes use. Such > configuration will be checked when creating Pulsar clients to instantiate > the DNS resolver. > If no configuration is provided the client must use current defaults. > > > # Detailed Design > > ## Design & Implementation Details > > The new configuration will be read from > org.apache.pulsar.client.impl.ConnectionPool to configure a > DnsNameResolverBuilder > > ## Public-facing Changes > Add new dnsServerAddresses method on > org.apache.pulsar.client.api.ClientBuilder. > > There are no breaking changes, if dnsServerAddresses is not configuret > Pulsar will continue to behave like now. > > > ### Public API > > NA > > ### Binary protocol > > NA > > ### Configuration > > Add new dnsServerAddresses property on > org.apache.pulsar.client.impl.conf.ClientConfigurationData. > > ### CLI > > NA > > ### Metrics > > NA > > # Monitoring > > NA > > # Security Considerations > > The client will have the ability to use a different seto of DNSes. It is > possible to alter hostnames resolutions however it is expected that this > does not pose any security risks. > > # Backward & Forward Compatibility > > ## Revert > > Just remove dnsServerAddresses configuration > > ## Upgrade > > Configure a dnsServerAddresses server list. The configuration is not > mandatory, Pulsar can run without it just like before. > > # Alternatives > > Expose an interface builder to fully configure the DNS layer. It has much > more impact and conflict with existing configuration properties > dnsLookupBindAddress and dnsLookupBindPort. > > Diego Salvi