Skip to content

Commit

Permalink
updating constructor with explicit gprc connection
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Yuknewicz <[email protected]>
  • Loading branch information
paulyuk committed Jul 29, 2024
1 parent 00eab71 commit 4e70fad
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions workflows/javascript/sdk/order-processor/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DaprWorkflowClient, WorkflowRuntime, DaprClient } from "@dapr/dapr";
import { DaprWorkflowClient, WorkflowRuntime, DaprClient, CommunicationProtocolEnum } from "@dapr/dapr";
import { InventoryItem, OrderPayload } from "./model";
import { notifyActivity, orderProcessingWorkflow, processPaymentActivity, requestApprovalActivity, reserveInventoryActivity, updateInventoryActivity } from "./orderProcessingWorkflow";

Expand All @@ -7,7 +7,15 @@ async function start() {
const workflowClient = new DaprWorkflowClient();
const workflowWorker = new WorkflowRuntime();

const daprClient = new DaprClient();
const daprHost = process.env.DAPR_HOST ?? "127.0.0.1";
const daprPort = process.env.DAPR_GRPC_PORT ?? "50001";

const daprClient = new DaprClient({
daprHost,
daprPort,
communicationProtocol: CommunicationProtocolEnum.GRPC,
});

const storeName = "statestore";

const inventory = new InventoryItem("item1", 100, 100);
Expand Down

0 comments on commit 4e70fad

Please sign in to comment.