diff --git a/.gitignore b/.gitignore index c47adad0a..cf9383703 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # General .venv .env +*.exe *.suo *.user _ReSharper.* diff --git a/state_management/csharp/http/README.md b/state_management/csharp/http/README.md index c5d785a8c..2b30a90cd 100644 --- a/state_management/csharp/http/README.md +++ b/state_management/csharp/http/README.md @@ -1,6 +1,6 @@ # Dapr state management (HTTP Client) -In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store in a state store. See [Why state management](#why-state-management) to understand when to use this API. +In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store in a state store. See [Why state management](https://docs.dapr.io/developing-applications/building-blocks/state-management/) to understand when to use this API. Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state-management/) link for more information about Dapr and State Management. @@ -8,11 +8,13 @@ Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state- This quickstart includes one service: -- Dotnet client service `order-processor` +- Dotnet client service `order-processor` -### Run Dotnet service with Dapr +## Run all apps with multi-app run template file -1. Open a new terminal window and navigate to `order-processor` directory: +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +1. Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): -2. Run the Dotnet service app with Dapr: + +2. Run the Dotnet service app with Dapr: + + + +```bash + dapr run -f . +``` + + +```bash + dapr stop -f . +``` + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- dotnet run` commands. This next section covers how to do this. + +1. Run the Dotnet service app with Dapr: - + ```bash cd ./order-processor dapr run --app-id order-processor --resources-path ../../../resources/ -- dotnet run ``` - +2. Stop and clean up application processes -```bash dapr stop --app-id order-processor -``` + \ No newline at end of file diff --git a/state_management/csharp/http/dapr.yaml b/state_management/csharp/http/dapr.yaml new file mode 100644 index 000000000..1c8ae4469 --- /dev/null +++ b/state_management/csharp/http/dapr.yaml @@ -0,0 +1,9 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["dotnet", "run"] + diff --git a/state_management/csharp/http/order-processor/Program.cs b/state_management/csharp/http/order-processor/Program.cs index 2e2dd0bff..c39a8c7af 100644 --- a/state_management/csharp/http/order-processor/Program.cs +++ b/state_management/csharp/http/order-processor/Program.cs @@ -9,7 +9,7 @@ var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); -for (int i = 1; i <= 10; i++) { +for (int i = 1; i <= 100; i++) { var orderId = i; var order = new Order(orderId); var orderJson = JsonSerializer.Serialize( diff --git a/state_management/csharp/sdk/README.md b/state_management/csharp/sdk/README.md index 37fdd10b4..0104689bb 100644 --- a/state_management/csharp/sdk/README.md +++ b/state_management/csharp/sdk/README.md @@ -1,31 +1,59 @@ # Dapr state management -In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. See [Why state management](#why-state-management) to understand when this pattern might be a good choice for your software architecture. +In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. See [Why state management](https://docs.dapr.io/developing-applications/building-blocks/state-management/) to understand when this pattern might be a good choice for your software architecture. Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state-management/) link for more information about Dapr and State Management. > **Note:** This example leverages the Dapr client SDK. If you are looking for the example using only HTTP [click here](../http). -This quickstart includes one service: +This quickstart includes one service: Dotnet client service `order-processor` -- Dotnet client service `order-processor` +## Run all apps with multi-app run template file -### Run Dotnet service with Dapr +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. -1. Open a new terminal window and navigate to `order-processor` directory: +1. Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): + ```bash + dotnet restore + dotnet build + ``` + + + +2. Run the Dotnet service app with Dapr: + + + + ```bash + dapr run -f . + ``` + +3. Stop and clean up application processes + ```bash -cd ./order-processor -dotnet restore -dotnet build + dapr stop -f . ``` - -2. Run the Dotnet service app with Dapr: + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- dotnet run` commands. This next section covers how to do this. + +1. Run the Dotnet service app with Dapr: - + ```bash cd ./order-processor dapr run --app-id order-processor --resources-path ../../../resources/ -- dotnet run ``` - +The Terminal console output should look similar to this: -```bash -dapr stop --app-id order-processor +```text +You're up and running! Both Dapr and your app logs will appear here. + +== APP == Saving Order: Order { orderId = 1 } +== APP == Getting Order: Order { orderId = 1 } +== APP == Deleting Order: Order { orderId = 1 } +== APP == Saving Order: Order { orderId = 2 } +== APP == Getting Order: Order { orderId = 2 } +== APP == Deleting Order: Order { orderId = 2 } +== APP == Saving Order: Order { orderId = 3 } +== APP == Getting Order: Order { orderId = 3 } +== APP == Deleting Order: Order { orderId = 3 } ``` + +2. Stop and clean up application processes + +dapr stop --app-id order-processor + \ No newline at end of file diff --git a/state_management/csharp/sdk/dapr.yaml b/state_management/csharp/sdk/dapr.yaml new file mode 100644 index 000000000..1c8ae4469 --- /dev/null +++ b/state_management/csharp/sdk/dapr.yaml @@ -0,0 +1,9 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["dotnet", "run"] + diff --git a/state_management/go/http/README.md b/state_management/go/http/README.md index f10c5f915..1e7d93699 100644 --- a/state_management/go/http/README.md +++ b/state_management/go/http/README.md @@ -1,16 +1,50 @@ # Dapr state management (HTTP Client) -In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. +In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store in a state store. See [Why state management](https://docs.dapr.io/developing-applications/building-blocks/state-management/) to understand when to use this API. -Visit the Dapr documentation on [State Management](https://docs.dapr.io/developing-applications/building-blocks/state-management/) for more information. +Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state-management/) link for more information about Dapr and State Management. -> **Note:** This example leverages plain HTTP. You can find an example using the Dapr Client SDK (recommended) in the [`sdk` folder](../sdk/). +> **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/). -This quickstart includes one service: Go client service `order-processor` +This quickstart includes one service: Go client service `order-processor` -### Run Go service with Dapr +## Run all apps with multi-app run template file -1. Run the Go service app with Dapr in the `order-processor` folder: +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): + +1. Run the Go service app with Dapr: + + + +```bash + dapr run -f . +``` + +2. Stop and cleanup application process + +```bash +dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- go run` commands. This next section covers how to do this. + +1. Run the Go service app with Dapr: ```bash cd ./order-processor -dapr run --app-id order-processor --resources-path ../../../resources -- go run . +dapr run --app-id order-processor --resources-path ../../../resources/ -- go run . ``` +The Terminal console output should look similar to this: + +```text +You're up and running! Both Dapr and your app logs will appear here. + +== APP == Saved Order: {"orderId":1} +== APP == Retrieved Order: "{\"orderId\":1}" +== APP == 2023/09/24 23:31:27 Deleted Order: {"orderId":1} +== APP == Saved Order: {"orderId":2} +== APP == Retrieved Order: "{\"orderId\":2}" +== APP == 2023/09/24 23:31:27 Deleted Order: {"orderId":2} +== APP == Saved Order: {"orderId":3} +== APP == Retrieved Order: "{\"orderId\":3}" +== APP == 2023/09/24 23:31:27 Deleted Order: {"orderId":3} +``` + +2. Stop and clean up application processes +dapr stop --app-id order-processor + diff --git a/state_management/go/http/dapr.yaml b/state_management/go/http/dapr.yaml new file mode 100644 index 000000000..09fe119c0 --- /dev/null +++ b/state_management/go/http/dapr.yaml @@ -0,0 +1,9 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["go", "run", "."] + diff --git a/state_management/go/http/order-processor/order_processor_example.exe b/state_management/go/http/order-processor/order_processor_example.exe new file mode 100644 index 000000000..a379e752b Binary files /dev/null and b/state_management/go/http/order-processor/order_processor_example.exe differ diff --git a/state_management/go/sdk/README.md b/state_management/go/sdk/README.md index 80f68a388..af7bed04e 100644 --- a/state_management/go/sdk/README.md +++ b/state_management/go/sdk/README.md @@ -1,6 +1,6 @@ # Dapr state management -In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. +In this quickstarts, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. Visit the Dapr documentation on [State Management](https://docs.dapr.io/developing-applications/building-blocks/state-management/) for more information. @@ -8,9 +8,43 @@ Visit the Dapr documentation on [State Management](https://docs.dapr.io/developi This quickstart includes one service: Go client service `order-processor` -### Run Go service with Dapr +## Run multiple apps with multi-app run template file -1. Run the Go service app with Dapr in the `order-processor` folder: +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): + +1. Run the Go service app with Dapr: + + + +```bash + dapr run -f . +``` + +2. Stop and cleanup application process + +```bash +dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- go run` commands. This next section covers how to do this. + +1. Run the Go service app with Dapr: ```bash cd ./order-processor -dapr run --app-id order-processor --resources-path ../../../resources -- go run . +dapr run --app-id order-processor --resources-path ../../../resources/ -- go run . ``` +The Terminal console output should look similar to this: + +```text +You're up and running! Both Dapr and your app logs will appear here. + + == APP - order-processor == Saved Order: {"orderId":1} + == APP - order-processor == Retrieved Order: {"orderId":1} + == APP - order-processor == Deleted Order: {"orderId":1} + == APP - order-processor == Saved Order: {"orderId":2} + == APP - order-processor == Retrieved Order: {"orderId":2} + == APP - order-processor == Deleted Order: {"orderId":2} +``` + +2. Stop and clean up application processes +dapr stop --app-id order-processor + diff --git a/state_management/go/sdk/dapr.yaml b/state_management/go/sdk/dapr.yaml new file mode 100644 index 000000000..a312578a2 --- /dev/null +++ b/state_management/go/sdk/dapr.yaml @@ -0,0 +1,8 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["go", "run", "."] diff --git a/state_management/java/http/README.md b/state_management/java/http/README.md index 2ce03e5d7..f77fef506 100644 --- a/state_management/java/http/README.md +++ b/state_management/java/http/README.md @@ -10,14 +10,18 @@ Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state- * [Dapr and Dapr Cli](https://docs.dapr.io/getting-started/install-dapr-cli/). * Java JDK 11 (or greater): - * [Microsoft JDK 11](https://docs.microsoft.com/en-us/java/openjdk/download#openjdk-11) - * [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK11) - * [OpenJDK 11](https://jdk.java.net/11/) + * [Microsoft JDK 11](https://docs.microsoft.com/en-us/java/openjdk/download#openjdk-11) + * [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK11) + * [OpenJDK 11](https://jdk.java.net/11/) * [Apache Maven](https://maven.apache.org/install.html) version 3.x. -This quickstart includes one service: +This quickstart includes one service: Java client service `order-processor` -- Java client service `order-processor` +## Run multiple apps with multi-app run template file + +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): ### Run Java service with Dapr @@ -27,9 +31,52 @@ This quickstart includes one service: name: Build Java file --> +```bash + cd ./order-processor + mvn clean install + cd .. +``` + + + +2. Run the Java service app with Dapr: + + + +```bash + dapr run -f . +``` + +3. Stop and cleanup application process + +```bash +dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +1. Open a new terminal window and navigate to `order-processor` directory: + + + ```bash cd ./order-processor mvn clean install +cd .. ``` @@ -46,16 +93,17 @@ expected_stdout_lines: expected_stderr_lines: output_match_mode: substring background: true -sleep: 15 +sleep: 60 --> - + ```bash cd ./order-processor dapr run --app-id order-processor --resources-path ../../../resources/ -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar ``` - +3. Stop and cleanup application process + ```bash dapr stop --app-id order-processor ``` diff --git a/state_management/java/http/dapr.yaml b/state_management/java/http/dapr.yaml new file mode 100644 index 000000000..e920c3b2f --- /dev/null +++ b/state_management/java/http/dapr.yaml @@ -0,0 +1,8 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["java", "-jar", "target/OrderProcessingService-0.0.1-SNAPSHOT.jar"] diff --git a/state_management/java/sdk/README.md b/state_management/java/sdk/README.md index ecffa9cc3..89b5abbe9 100644 --- a/state_management/java/sdk/README.md +++ b/state_management/java/sdk/README.md @@ -10,14 +10,18 @@ Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state- * [Dapr and Dapr Cli](https://docs.dapr.io/getting-started/install-dapr-cli/). * Java JDK 11 (or greater): - * [Microsoft JDK 11](https://docs.microsoft.com/en-us/java/openjdk/download#openjdk-11) - * [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK11) - * [OpenJDK 11](https://jdk.java.net/11/) + * [Microsoft JDK 11](https://docs.microsoft.com/en-us/java/openjdk/download#openjdk-11) + * [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK11) + * [OpenJDK 11](https://jdk.java.net/11/) * [Apache Maven](https://maven.apache.org/install.html) version 3.x. -This quickstart includes one service: +This quickstart includes one service: Java client service `order-processor` -- Java client service `order-processor` +## Run multiple apps with multi-app run template file + +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): ### Run Java service with Dapr @@ -27,9 +31,52 @@ This quickstart includes one service: name: Build Java file --> +```bash + cd ./order-processor + mvn clean install + cd .. +``` + + + +2. Run the Java service app with Dapr: + + + +```bash + dapr run -f . +``` + +3. Stop and cleanup application process + +```bash + dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +1. Open a new terminal window and navigate to `order-processor` directory: + + + ```bash cd ./order-processor mvn clean install +cd .. ``` @@ -38,23 +85,25 @@ mvn clean install - + ```bash cd ./order-processor dapr run --app-id order-processor --resources-path ../../../resources/ -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar ``` - +3. Stop and cleanup application process + ```bash dapr stop --app-id order-processor ``` diff --git a/state_management/java/sdk/dapr.yaml b/state_management/java/sdk/dapr.yaml new file mode 100644 index 000000000..e920c3b2f --- /dev/null +++ b/state_management/java/sdk/dapr.yaml @@ -0,0 +1,8 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["java", "-jar", "target/OrderProcessingService-0.0.1-SNAPSHOT.jar"] diff --git a/state_management/javascript/http/README.md b/state_management/javascript/http/README.md index a23572b18..b31e99bca 100644 --- a/state_management/javascript/http/README.md +++ b/state_management/javascript/http/README.md @@ -6,11 +6,58 @@ Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state- > **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/). -This quickstart includes one service: +This quickstart includes one service: Node client service `order-processor` -- Node client service `order-processor` +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. -### Run Node service with Dapr +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): + +1. Open a new terminal window and navigate to `order-processor` directory: + + + +```bash + cd ./order-processor + npm install + cd .. +``` + + + +2. Run the Node service app with Dapr: + + + +```bash + dapr run -f . +``` + + +3. Stop and cleanup application process + +```bash + dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- npm start` commands. This next section covers how to do this. + +## Run Node service with Dapr 1. Navigate to folder and install dependencies: @@ -19,8 +66,8 @@ name: Install Node dependencies --> ```bash -cd ./order-processor -npm install + cd ./order-processor + npm install ``` @@ -35,6 +82,7 @@ expected_stdout_lines: expected_stderr_lines: working_dir: ./order-processor output_match_mode: substring +match_order: none background: true sleep: 10 --> @@ -42,9 +90,10 @@ sleep: 10 ```bash dapr run --app-id order-processor --resources-path ../../../resources/ -- npm start ``` - +2. Stop and cleanup the process + ```bash dapr stop --app-id order-processor ``` diff --git a/state_management/javascript/http/dapr.yaml b/state_management/javascript/http/dapr.yaml new file mode 100644 index 000000000..02f12d78e --- /dev/null +++ b/state_management/javascript/http/dapr.yaml @@ -0,0 +1,8 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["npm", "run", "start"] diff --git a/state_management/javascript/sdk/README.md b/state_management/javascript/sdk/README.md index 77ea6f3c5..2677e4458 100644 --- a/state_management/javascript/sdk/README.md +++ b/state_management/javascript/sdk/README.md @@ -1,20 +1,61 @@ -# Dapr state management +# Dapr state management (SDK Client) In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. See [Why state management](#why-state-management) to understand when this pattern might be a good choice for your software architecture. Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state-management/) link for more information about Dapr and State Management. -> **Note:** This example leverages the Dapr client SDK. If you are looking for the example using only HTTP [click here](../http). +> **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/). -This quickstart includes one service: +This quickstart includes one service: Node client service `order-processor` -- Node client service `order-processor` +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. -This quickstart includes one service: +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): -- Node client service `order-processor` +1. Open a new terminal window and navigate to `order-processor` directory: -### Run Node service with Dapr + + +```bash + cd ./order-processor + npm install + cd .. +``` + + + +2. Run the Node service app with Dapr: + + + +```bash + dapr run -f . +``` + +3. Stop and cleanup application process + +```bash + dapr stop -f . +``` + + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- npm start` commands. This next section covers how to do this. + +## Run Node service with Dapr 1. Navigate to folder and install dependencies: @@ -23,13 +64,13 @@ name: Install Node dependencies --> ```bash -cd ./order-processor -npm install + cd ./order-processor + npm install ``` 2. Run the Node service app with Dapr: - + ```bash dapr run --app-id order-processor --resources-path ../../../resources/ -- npm start ``` - +2. Stop and cleanup the process ```bash dapr stop --app-id order-processor ``` + diff --git a/state_management/javascript/sdk/dapr.yaml b/state_management/javascript/sdk/dapr.yaml new file mode 100644 index 000000000..02f12d78e --- /dev/null +++ b/state_management/javascript/sdk/dapr.yaml @@ -0,0 +1,8 @@ + +version: 1 +common: + resourcesPath: ../../resources/ +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["npm", "run", "start"] diff --git a/state_management/python/http/README.md b/state_management/python/http/README.md index f554e6ccd..38f2fe606 100644 --- a/state_management/python/http/README.md +++ b/state_management/python/http/README.md @@ -6,11 +6,13 @@ Visit [this](https://docs.dapr.io/developing-applications/building-blocks/state- > **Note:** This example leverages HTTP `requests` only. If you are looking for the example using the Dapr Client SDK (recommended) [click here](../sdk/). -This quickstart includes one service: - -- Python service `order-processor` +This quickstart includes one service: Python service `order-processor` -### Run Python service with Dapr +This section shows how to run applications at once using [multi-app run template files](https://docs.dapr.io/developing-applications/local-development/multi-app-dapr-run/multi-app-overview/) with `dapr run -f .`. This enables to you test the interactions between multiple applications. + +Open a new terminal window and run `order-processor` using the multi app run template defined in [dapr.yaml](./dapr.yaml): + +## Run Python service with Dapr 1. Open a new terminal window and navigate to `order-processor` directory: @@ -21,11 +23,41 @@ name: Install python dependencies ```bash cd ./order-processor pip3 install -r requirements.txt +cd .. ``` + 2. Run the Python service app with Dapr: + + +```bash +dapr run -f . +``` + + + +```bash +dapr stop -f . +``` + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- python3 app.py` commands. This next section covers how to do this. + +1. Run the Python service app with Dapr: + + 2. Run the Python service app with Dapr: + + +```bash +dapr run -f . +``` + + + +```bash +dapr stop -f . +``` + +## Run a single app at a time with Dapr (Optional) + +An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple `dapr run .. -- python3 app.py` commands. This next section covers how to do this. + +1. Run the Python service app with Dapr: +