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

Commit

Permalink
tristate plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbernstein2 committed Feb 2, 2018
1 parent d5b53cf commit f66df01
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -66,7 +66,7 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP
private final ExecutorProvider executorProvider;
private final HeaderProvider headerProvider;
private final String endpoint;
private final boolean skipNegotiation;
@Nullable private final Boolean skipNegotiation;
@Nullable private final Integer maxInboundMessageSize;
@Nullable private final Duration keepAliveTime;
@Nullable private final Duration keepAliveTimeout;
Expand Down Expand Up @@ -170,9 +170,11 @@ private ManagedChannel createSingleChannel() throws IOException {
ManagedChannelBuilder.forAddress(serviceAddress, port)
.intercept(headerInterceptor)
.userAgent(headerInterceptor.getUserAgentHeader())
.executor(executor)
.usePlaintext(skipNegotiation);
.executor(executor);

if (skipNegotiation != null) {
builder.usePlaintext(skipNegotiation);
}
if (maxInboundMessageSize != null) {
builder.maxInboundMessageSize(maxInboundMessageSize);
}
Expand Down Expand Up @@ -227,7 +229,7 @@ public static final class Builder {
private ExecutorProvider executorProvider;
private HeaderProvider headerProvider;
private String endpoint;
private boolean skipNegotiation;
@Nullable private Boolean skipNegotiation;
@Nullable private Integer maxInboundMessageSize;
@Nullable private Duration keepAliveTime;
@Nullable private Duration keepAliveTimeout;
Expand Down

0 comments on commit f66df01

Please sign in to comment.