Skip to content

Commit a27629b

Browse files
authored
Update index.js
Signed-off-by: Deepanshu Agarwal <[email protected]>
1 parent 50ef1c5 commit a27629b

File tree

1 file changed

+5
-5
lines changed
  • configuration/javascript/sdk/order-processor

1 file changed

+5
-5
lines changed

configuration/javascript/sdk/order-processor/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { CommunicationProtocolEnum, DaprClient } from "@dapr/dapr";
22

33
// JS SDK does not support Configuration API over HTTP protocol yet
4-
// const communicationProtocol = CommunicationProtocolEnum.GRPC;
4+
const communicationProtocol = CommunicationProtocolEnum.GRPC;
55
const daprHost = "localhost";
6-
const daprPort = 3500;
6+
const daprPort = 50001;
77

88
const DAPR_CONFIGURATION_STORE = "configstore";
99
const CONFIGURATION_ITEMS = ["orderId1", "orderId2"];
@@ -13,12 +13,12 @@ function sleep(ms) {
1313
}
1414

1515
async function main() {
16-
const client = new DaprClient({daprHost, daprPort});
16+
const client = new DaprClient({daprHost, daprPort, communicationProtocol});
1717
// await client.health.isHealthy();
1818
console.time("myFunction");
19-
await sleep(5000);
19+
await sleep(20000);
2020
console.timeEnd("myFunction");
21-
console.log("Waited for 5 seconds.");
21+
console.log("Waited for 20 seconds.");
2222
// Get config items from the config store
2323
try {
2424
const config = await client.configuration.get(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS);

0 commit comments

Comments
 (0)