Skip to content

Commit b93252e

Browse files
committed
enable/disable service discovery for fabric gateway
Signed-off-by: adityajoshi12 <[email protected]>
1 parent 2db7973 commit b93252e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Diff for: src/main/java/hlf/java/rest/client/config/FabricProperties.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class FabricProperties {
2222
"org.hyperledger.fabric.sdk.service_discovery.as_localhost";
2323

2424
private boolean localhostReportAddress;
25+
private boolean discoveryEnabled = true;
2526
private WalletConfig wallet;
2627
private OrgConnectionConfig orgConnectionConfig;
2728
private Client client;

Diff for: src/main/java/hlf/java/rest/client/config/GatewayConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Gateway gateway(Wallet wallet) throws IOException {
4848
builder
4949
.identity(wallet, fabricProperties.getWallet().getClientUser().getName())
5050
.networkConfig(networkConfigPath)
51-
.discovery(true);
51+
.discovery(fabricProperties.isDiscoveryEnabled());
5252
return builder.connect();
5353
}
5454

Diff for: src/main/resources/application.template

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
spring:
22
profiles.active: local
3-
3+
44
---
55
springdoc:
66
version: 1.0.0
@@ -15,6 +15,7 @@ metrics:
1515
kafka:
1616
enable: false
1717
fabric:
18+
discoveryEnabled: true
1819
localhostReportAddress: true
1920
wallet:
2021
path: wallet
@@ -74,7 +75,7 @@ spring:
7475
profiles: container
7576
devtools.add-properties: false
7677
localhostReportAddress: false
77-
78+
7879
---
7980
spring:
8081
profiles: qa
@@ -86,11 +87,10 @@ spring:
8687
profiles: stg
8788
devtools.add-properties: false
8889
localhostReportAddress: false
89-
90-
90+
91+
9192
---
9293
spring:
93-
profiles: prod
94+
profiles: prod
9495
devtools.add-properties: false
9596
localhostReportAddress: false
96-

0 commit comments

Comments
 (0)