Avoid deprecated nameResolverFactory
- Dominant language
- Scala
- Stars
- 55
- Forks
- 30
- Avg merge
- 23h 12m
- Merged PRs (30d)
- 34
Description
I was reading the code for name solver and found a todo item, hoping to resolve it.
# motivation
same issue in akka-grpc https://github.com/akka/akka-grpc/issues/1092
code in pekko `org.apache.pekko.grpc.internal.NettyClientUtils`
https://github.com/apache/pekko-grpc/blob/7f4b94cf7200be1506449da86d5811246c87af0d/runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala#L49-L64
# changes
according to grpc-java
https://github.com/grpc/grpc-java/blob/497e1552172632107574d67d7c092a3f5a39a980/examples/src/main/java/io/grpc/examples/nameresolve/NameResolveClient.java#L39
we just need
```scala
NameResolverRegistry.getDefaultRegistry.register(
new PekkoDiscoveryNameResolverProvider(
settings.serviceDiscovery,
settings.defaultPort,
settings.serviceName,
settings.servicePortName,
settings.serviceProtocol,
settings.resolveTimeout))
```
Contributor guide
Research direction
Start with runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala, especially the name-resolver code around lines 49–64. Compare it with the linked grpc-java NameResolveClient example and the proposed NameResolverRegistry registration. Done means the deprecated nameResolverFactory usage is replaced without changing the resolver settings passed to PekkoDiscoveryNameResolverProvider.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, scala
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100