Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 31727ee

Browse files
FGJ-36 set sensible defaults for grpc - part2
Change-Id: I1f56335dbb2ec660f8bed769a344e61377e9ce5f Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
1 parent eef82e2 commit 31727ee

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/org/hyperledger/fabric/sdk/HFClient.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ private void setDefaultProperties(Properties props) {
163163
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveTimeout")) {
164164
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {20L, TimeUnit.SECONDS});
165165
}
166-
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveTime")) {
167-
props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {2L, TimeUnit.MINUTES});
168-
}
169166
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls")) {
170167
props.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[] {true});
171168
}

src/test/java/org/hyperledger/fabric/sdk/NetworkConfigTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,12 @@ public void testLoadFromConfigFileYamlNOOverrides() throws Exception {
301301
assertNotNull(properties);
302302
// check for default properties
303303
Object[] o = (Object[]) properties.get("grpc.NettyChannelBuilderOption.keepAliveTime");
304-
assertEquals(o[0], 120000L);
304+
assertEquals(o[0], 2L);
305+
assertEquals(o[1], TimeUnit.MINUTES);
305306

306307
o = (Object[]) properties.get("grpc.NettyChannelBuilderOption.keepAliveTimeout");
307-
assertEquals(o[0], 20000L);
308+
assertEquals(o[0], 20L);
309+
assertEquals(o[1], TimeUnit.SECONDS);
308310

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

0 commit comments

Comments
 (0)