Remove deprecated nameResolverFactory method. (#7132)
This commit is contained in:
parent
4698681e7c
commit
e21cb196fc
|
|
@ -11,6 +11,7 @@ Release Notes.
|
|||
* Supports modifying span attributes in async mode.
|
||||
* Agent supports the collection of JVM arguments and jar dependency information.
|
||||
* [Temporary] Support authentication for log report channel. This feature and grpc channel is going to be removed after Satellite 0.2.0 release.
|
||||
* Remove deprecated gRPC method, `io.grpc.ManagedChannelBuilder#nameResolverFactory`. See [gRPC-java 7133](https://github.com/grpc/grpc-java/issues/7133) for more details.
|
||||
|
||||
#### OAP-Backend
|
||||
* Disable Spring sleuth meter analyzer by default.
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import io.grpc.Channel;
|
|||
import io.grpc.ConnectivityState;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.NameResolverRegistry;
|
||||
import io.grpc.internal.DnsNameResolverProvider;
|
||||
import io.grpc.netty.NettyChannelBuilder;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
|
@ -34,9 +36,11 @@ public class GRPCChannel {
|
|||
private final Channel channelWithDecorators;
|
||||
|
||||
private GRPCChannel(String host, int port, List<ChannelBuilder> channelBuilders,
|
||||
List<ChannelDecorator> decorators) throws Exception {
|
||||
List<ChannelDecorator> decorators) throws Exception {
|
||||
ManagedChannelBuilder channelBuilder = NettyChannelBuilder.forAddress(host, port);
|
||||
|
||||
NameResolverRegistry.getDefaultRegistry().register(new DnsNameResolverProvider());
|
||||
|
||||
for (ChannelBuilder builder : channelBuilders) {
|
||||
channelBuilder = builder.build(channelBuilder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,15 +19,13 @@
|
|||
package org.apache.skywalking.apm.agent.core.remote;
|
||||
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.internal.DnsNameResolverProvider;
|
||||
|
||||
public class StandardChannelBuilder implements ChannelBuilder {
|
||||
private final static int MAX_INBOUND_MESSAGE_SIZE = 1024 * 1024 * 50;
|
||||
|
||||
@Override
|
||||
public ManagedChannelBuilder build(ManagedChannelBuilder managedChannelBuilder) {
|
||||
return managedChannelBuilder.nameResolverFactory(new DnsNameResolverProvider())
|
||||
.maxInboundMessageSize(MAX_INBOUND_MESSAGE_SIZE)
|
||||
return managedChannelBuilder.maxInboundMessageSize(MAX_INBOUND_MESSAGE_SIZE)
|
||||
.usePlaintext();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue