WebClient DNS caching behavior and TTL inconsistency
0 reputation · 07 Jan 2020, 13:55 UTC
Spring WebClient delegates network operations to the underlying Reactor Netty HttpClient. While the JVM provides global DNS caching controls via system properties, different HTTP client implementations may handle DNS Time-To-Live (TTL) and record expiration independently of the standard JVM settings.
When deploying in dynamic environments where service IP addresses change frequently, relying on the default JVM sun.net.inetaddr.ttl may not guarantee that the underlying Netty name resolver honors the same caching logic, potentially leading to stale connection attempts.
- Does the Reactor Netty name resolver strictly follow JVM system properties for DNS TTL?
- What is the documented mechanism for overriding DNS caching specifically for the WebClient transport layer without affecting the entire JVM?