public class RoundRobinDnsAddressResolverGroup extends DnsAddressResolverGroup
AddressResolverGroup
of DnsNameResolver
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 and Description |
---|
RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory,
DnsServerAddressStreamProvider nameServerProvider) |
RoundRobinDnsAddressResolverGroup(Class<? extends DatagramChannel> channelType,
DnsServerAddressStreamProvider nameServerProvider) |
RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder) |
Modifier and Type | Method and Description |
---|---|
protected AddressResolver<InetSocketAddress> |
newAddressResolver(EventLoop eventLoop,
NameResolver<InetAddress> resolver)
We need to override this method, not
DnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider) ,
because we need to eliminate possible caching of NameResolver.resolve(java.lang.String)
by InflightNameResolver created in
DnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider) . |
newNameResolver, newResolver, newResolver
close, getResolver
public RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder)
public RoundRobinDnsAddressResolverGroup(Class<? extends DatagramChannel> channelType, DnsServerAddressStreamProvider nameServerProvider)
public RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory, DnsServerAddressStreamProvider nameServerProvider)
protected final AddressResolver<InetSocketAddress> newAddressResolver(EventLoop eventLoop, NameResolver<InetAddress> resolver) throws Exception
DnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
,
because we need to eliminate possible caching of NameResolver.resolve(java.lang.String)
by InflightNameResolver
created in
DnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
.newAddressResolver
in class DnsAddressResolverGroup
Exception
Copyright © 2008–2024 The Netty Project. All rights reserved.