Remove NameResolver.Factory
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
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.
Contributor guide
Assessment
This issue has not been assessed yet.