Module io.netty5.resolver.dns
Package io.netty5.resolver.dns
Class RoundRobinDnsAddressResolverGroup
- java.lang.Object
-
- io.netty5.resolver.AddressResolverGroup<InetSocketAddress>
-
- io.netty5.resolver.dns.DnsAddressResolverGroup
-
- io.netty5.resolver.dns.RoundRobinDnsAddressResolverGroup
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class RoundRobinDnsAddressResolverGroup extends DnsAddressResolverGroup
AAddressResolverGroup
ofDnsNameResolver
s that supports random selection of destination addresses if multiple are provided by the nameserver. This is ideal for use in applications that use a pool of connections, for which connecting to a single resolved address would be inefficient.
-
-
Constructor Summary
Constructors Constructor Description RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory, DnsServerAddressStreamProvider nameServerProvider)
RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder)
RoundRobinDnsAddressResolverGroup(Class<? extends DatagramChannel> channelType, DnsServerAddressStreamProvider nameServerProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AddressResolver<InetSocketAddress>
newAddressResolver(EventLoop eventLoop, NameResolver<InetAddress> resolver)
We need to override this method, notDnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
, because we need to eliminate possible caching ofNameResolver.resolve(java.lang.String)
byInflightNameResolver
created inDnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
.-
Methods inherited from class io.netty5.resolver.dns.DnsAddressResolverGroup
newNameResolver, newResolver, newResolver
-
Methods inherited from class io.netty5.resolver.AddressResolverGroup
close, getResolver
-
-
-
-
Constructor Detail
-
RoundRobinDnsAddressResolverGroup
public RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder)
-
RoundRobinDnsAddressResolverGroup
public RoundRobinDnsAddressResolverGroup(Class<? extends DatagramChannel> channelType, DnsServerAddressStreamProvider nameServerProvider)
-
RoundRobinDnsAddressResolverGroup
public RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory, DnsServerAddressStreamProvider nameServerProvider)
-
-
Method Detail
-
newAddressResolver
protected final AddressResolver<InetSocketAddress> newAddressResolver(EventLoop eventLoop, NameResolver<InetAddress> resolver) throws Exception
We need to override this method, notDnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
, because we need to eliminate possible caching ofNameResolver.resolve(java.lang.String)
byInflightNameResolver
created inDnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
.- Overrides:
newAddressResolver
in classDnsAddressResolverGroup
- Throws:
Exception
-
-