Description
NameResolver.Factory
is old and was meant to be replaced by NameResolverProvider
. I've been slowly trying to remove it, especially ManagedChannelBuilder.nameResolverFactory()
. I see evidence new users are using it, so this issue is to be a gathering point for why it is being removed and making sure there are alternatives to the current usages.
Since NameResolverRegistry was added in v1.21, most users shouldn't need the factory. A small number of users may need a "default name resolver override". This would be similar to defaultLoadBalancingPolicy()
which was added when we removed loadBalancerFactory()
. However, the NameResolver API needs tweaks to support that, where each NameResolver would be for a particular scheme and the NameResolverRegistry would select the appropriate NameResolver (instead of the current "call all the name resolvers in order until one understands the URI").
NameResolver.Factory is used internally in grpc. I don't care much about that, since it does little harm, but I don't expect NameResolver.Factory to ever become stable and it should be removed. It just may go slowly due to priorities.