diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index e74f9ded25..d4a92d6e68 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -235,12 +235,13 @@ netty's AddressResolver that resolves DNS names on is not available, otherwise defaults to io.netty.resolver.dns.DnsAddressResolverGroup

Users of DNS-based Redis-HA setups (e.g. AWS ElastiCache) might want to configure a different DNS resolver group. For example:

-DnsNameResolverBuilder builder = new DnsNameResolverBuilder();
-builder.resolveCache(NoopDnsCache.INSTANCE);
-builder.cnameCache(NoopDnsCnameCache.INSTANCE);
-builder.authoritativeDnsServerCache(NoopAuthoritativeDnsServerCache.INSTANCE);
-builder.consolidateCacheSize(0);
-new DnsAddressResolverGroup(builder);
+new DnsAddressResolverGroup(
+	new DnsNameResolverBuilder()
+		.resolveCache(NoopDnsCache.INSTANCE)
+		.cnameCache(NoopDnsCnameCache.INSTANCE)
+		.authoritativeDnsServerCache(NoopAuthoritativeDnsServerCache.INSTANCE)
+		.consolidateCacheSize(0)
+);