Skip to content

Commit

Permalink
FGJ-36 set sensible defaults for grpc - part2
Browse files Browse the repository at this point in the history
Change-Id: I1f56335dbb2ec660f8bed769a344e61377e9ce5f
Signed-off-by: andrew-coleman <[email protected]>
  • Loading branch information
andrew-coleman committed Aug 20, 2019
1 parent eef82e2 commit 31727ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/main/java/org/hyperledger/fabric/sdk/HFClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ private void setDefaultProperties(Properties props) {
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveTimeout")) {
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {20L, TimeUnit.SECONDS});
}
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveTime")) {
props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {2L, TimeUnit.MINUTES});
}
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls")) {
props.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[] {true});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ public void testLoadFromConfigFileYamlNOOverrides() throws Exception {
assertNotNull(properties);
// check for default properties
Object[] o = (Object[]) properties.get("grpc.NettyChannelBuilderOption.keepAliveTime");
assertEquals(o[0], 120000L);
assertEquals(o[0], 2L);
assertEquals(o[1], TimeUnit.MINUTES);

o = (Object[]) properties.get("grpc.NettyChannelBuilderOption.keepAliveTimeout");
assertEquals(o[0], 20000L);
assertEquals(o[0], 20L);
assertEquals(o[1], TimeUnit.SECONDS);

o = (Object[]) properties.get("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls");
assertEquals(o[0], true);
Expand Down

0 comments on commit 31727ee

Please sign in to comment.