File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
configuration/javascript/sdk/order-processor Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { CommunicationProtocolEnum , DaprClient } from "@dapr/dapr" ;
2
2
3
3
// JS SDK does not support Configuration API over HTTP protocol yet
4
- // const communicationProtocol = CommunicationProtocolEnum.GRPC;
4
+ const communicationProtocol = CommunicationProtocolEnum . GRPC ;
5
5
const daprHost = "localhost" ;
6
- const daprPort = 3500 ;
6
+ const daprPort = 50001 ;
7
7
8
8
const DAPR_CONFIGURATION_STORE = "configstore" ;
9
9
const CONFIGURATION_ITEMS = [ "orderId1" , "orderId2" ] ;
@@ -13,12 +13,12 @@ function sleep(ms) {
13
13
}
14
14
15
15
async function main ( ) {
16
- const client = new DaprClient ( { daprHost, daprPort} ) ;
16
+ const client = new DaprClient ( { daprHost, daprPort, communicationProtocol } ) ;
17
17
// await client.health.isHealthy();
18
18
console . time ( "myFunction" ) ;
19
- await sleep ( 5000 ) ;
19
+ await sleep ( 20000 ) ;
20
20
console . timeEnd ( "myFunction" ) ;
21
- console . log ( "Waited for 5 seconds." ) ;
21
+ console . log ( "Waited for 20 seconds." ) ;
22
22
// Get config items from the config store
23
23
try {
24
24
const config = await client . configuration . get ( DAPR_CONFIGURATION_STORE , CONFIGURATION_ITEMS ) ;
You can’t perform that action at this time.
0 commit comments