From 6f6382ab6d16b4ae52a28bb657ff7f0efa1c1bd9 Mon Sep 17 00:00:00 2001 From: Yingyu Cheng <1443504+winguse@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:35:34 -0700 Subject: [PATCH] update doc --- docs/advanced-usage.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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)
+);