Closed
Description
Expected behavior
When doing lookups, we are connecting to the endpoint represented by its serviceUrl
. When using native Pulsar protocol, we should resolve the DNS at each attempt, in order to adapt when the DNS config changes.
Additionally, at each attempt, we need to try all the IP addresses returned by DNS, since in same cases DNS is used as a service discovery mechanism.
This is already working correctly on HTTP based lookup where the serviceUrl is passed to asyncHttpClient
library.
Actual behavior
Currently, the client impl is resolving the serviceUrl name at startup at it is caching the 1st IP address:
- We should defer resolving until we are actually connecting, so that new attempts might be leading to a different IP returned by DNS server.
- We should try all the returned IP addresses until a successful connection can be established
- Additionally, we should use Netty async DnsResolver class to do it asynchronously.
Activity