Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
switch from NettyChannelBuilder to ManagedChannelBuilder (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
neozwu committed Mar 1, 2017
1 parent ec2e656 commit 7f23198
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
import com.google.common.collect.Lists;
import io.grpc.ClientInterceptor;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.auth.ClientAuthInterceptor;
import io.grpc.netty.NegotiationType;
import io.grpc.netty.NettyChannelBuilder;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
Expand Down Expand Up @@ -116,8 +115,8 @@ private ManagedChannel createChannel(Executor executor) throws IOException {
interceptors.add(new ClientAuthInterceptor(credentialsProvider.getCredentials(), executor));
interceptors.add(new HeaderInterceptor(serviceHeader()));

return NettyChannelBuilder.forAddress(serviceAddress, port)
.negotiationType(NegotiationType.TLS)
//By default ManagedChannel uses TLS negotiationType
return ManagedChannelBuilder.forAddress(serviceAddress, port)
.intercept(interceptors)
.executor(executor)
.build();
Expand Down

0 comments on commit 7f23198

Please sign in to comment.