Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Readme's to default to dapr run -f . #874

Merged
merged 13 commits into from
Sep 22, 2023
Merged
84 changes: 62 additions & 22 deletions pub_sub/csharp/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,69 @@ And one subscriber:

- Dotnet subscriber `order-processor`

### Run Dotnet message subscriber with Dapr
## Run all apps with multi-app run template file:

This section shows how to run both 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. Navigate to the directory and install dependencies:
1. Open a new terminal window and run `order-processor` and `checkout` using the multi app run template defined in [dapr.yaml](./dapr.yaml):

<!-- STEP
name: Install Dotnet dependencies
name: Run multi app run template
expected_stdout_lines:
- 'Started Dapr with app id "order-processor-http"'
- 'Started Dapr with app id "checkout-http"'
- '== APP - checkout-http == Published data: Order { OrderId = 10 }'
- '== APP - order-processor-http == Subscriber received : 10'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
timeout_seconds: 30
-->

```bash
cd ./order-processor
dotnet restore
dotnet build
dapr run -f .
```

The terminal console output should look similar to this:

```text
== APP - checkout-http == Published data: Order { OrderId = 1 }
== APP - order-processor-http == Subscriber received : 1
== APP - checkout-http == Published data: Order { OrderId = 2 }
== APP - order-processor-http == Subscriber received : 2
== APP - checkout-http == Published data: Order { OrderId = 3 }
== APP - order-processor-http == Subscriber received : 3
== APP - checkout-http == Published data: Order { OrderId = 4 }
== APP - order-processor-http == Subscriber received : 4
== APP - checkout-http == Published data: Order { OrderId = 5 }
== APP - order-processor-http == Subscriber received : 5
== APP - checkout-http == Published data: Order { OrderId = 6 }
== APP - order-processor-http == Subscriber received : 6
== APP - checkout-http == Published data: Order { OrderId = 7 }
== APP - order-processor-http == Subscriber received : 7
== APP - checkout-http == Published data: Order { OrderId = 8 }
== APP - order-processor-http == Subscriber received : 8
== APP - checkout-http == Published data: Order { OrderId = 9 }
== APP - order-processor-http == Subscriber received : 9
== APP - checkout-http == Published data: Order { OrderId = 10 }
== APP - order-processor-http == Subscriber received : 10
```

2. Stop and clean up application processes

```bash
dapr stop -f .
```
<!-- END_STEP -->
2. Run the Dotnet subscriber 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.

### Run Dotnet message subscriber with Dapr

1. Run the Dotnet subscriber app with Dapr:

<!-- STEP
name: Run Dotnet subscriber
Expand All @@ -46,25 +94,14 @@ sleep: 10


```bash
dapr run --app-id order-processor-http --resources-path ../../../components/ --app-port 7005 -- dotnet run --project .
cd ./order-processor
dapr run --app-id order-processor-http --resources-path ../../../components/ --app-port 7005 -- dotnet run
```

<!-- END_STEP -->
### Run Dotnet message publisher with Dapr

1. Navigate to the directory and install dependencies:

<!-- STEP
name: Install Dotnet dependencies
-->

```bash
cd ./checkout
dotnet restore
dotnet build
```
<!-- END_STEP -->
2. Run the Dotnet publisher app with Dapr:
1. Run the Dotnet publisher app with Dapr:

<!-- STEP
name: Run Dotnet publisher
Expand All @@ -82,11 +119,14 @@ sleep: 10
-->

```bash
dapr run --app-id checkout-http --resources-path ../../../components/ -- dotnet run --project .
cd ./checkout
dapr run --app-id checkout-http --resources-path ../../../components/ -- dotnet run
```

<!-- END_STEP -->

2. Stop and clean up application processes

```bash
dapr stop --app-id order-processor-http
dapr stop --app-id checkout-http
Expand Down
11 changes: 11 additions & 0 deletions pub_sub/csharp/http/dapr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1
common:
resourcesPath: ../../components/
apps:
- appID: order-processor-http
appDirPath: ./order-processor/
appPort: 7005
command: ["dotnet", "run"]
- appID: checkout-http
appDirPath: ./checkout/
command: ["dotnet", "run"]
83 changes: 61 additions & 22 deletions pub_sub/csharp/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,68 @@ And one subscriber:

- Dotnet subscriber `order-processor`

### Run Dotnet message subscriber with Dapr
## Run all apps with multi-app run template file:

This section shows how to run both 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. Navigate to the directory and install dependencies:
1. Open a new terminal window and run the multi app run template:

<!-- STEP
name: Install Dotnet dependencies
name: Run multi app run template
expected_stdout_lines:
- 'Started Dapr with app id "order-processor"'
- 'Started Dapr with app id "checkout-sdk"'
- '== APP - checkout-sdk == Published data: Order { OrderId = 10 }'
- '== APP - order-processor == Subscriber received : Order { OrderId = 10 }'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->

```bash
cd ./order-processor
dotnet restore
dotnet build
dapr run -f .
```

The terminal console output should look similar to this:

```text
== APP - checkout-sdk == Published data: Order { OrderId = 1 }
== APP - order-processor == Subscriber received : Order { OrderId = 1 }
== APP - checkout-sdk == Published data: Order { OrderId = 2 }
== APP - order-processor == Subscriber received : Order { OrderId = 2 }
== APP - checkout-sdk == Published data: Order { OrderId = 3 }
== APP - order-processor == Subscriber received : Order { OrderId = 3 }
== APP - checkout-sdk == Published data: Order { OrderId = 4 }
== APP - order-processor == Subscriber received : Order { OrderId = 4 }
== APP - checkout-sdk == Published data: Order { OrderId = 5 }
== APP - order-processor == Subscriber received : Order { OrderId = 5 }
== APP - checkout-sdk == Published data: Order { OrderId = 6 }
== APP - order-processor == Subscriber received : Order { OrderId = 6 }
== APP - checkout-sdk == Published data: Order { OrderId = 7 }
== APP - order-processor == Subscriber received : Order { OrderId = 7 }
== APP - checkout-sdk == Published data: Order { OrderId = 8 }
== APP - order-processor == Subscriber received : Order { OrderId = 8 }
== APP - checkout-sdk == Published data: Order { OrderId = 9 }
== APP - order-processor == Subscriber received : Order { OrderId = 9 }
== APP - checkout-sdk == Published data: Order { OrderId = 10 }
== APP - order-processor == Subscriber received : Order { OrderId = 10 }
```

2. Stop and clean up application processes

```bash
dapr stop -f .
```
<!-- END_STEP -->
2. Run the Dotnet subscriber 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.

### Run Dotnet message subscriber with Dapr

1. Run the Dotnet subscriber app with Dapr:

<!-- STEP
name: Run Dotnet subscriber
Expand All @@ -46,25 +93,14 @@ sleep: 10


```bash
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 7006 -- dotnet run --project .
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 7006 -- dotnet run
```

<!-- END_STEP -->
### Run Dotnet message publisher with Dapr

1. Navigate to the directory and install dependencies:

<!-- STEP
name: Install Dotnet dependencies
-->

```bash
cd ./checkout
dotnet restore
dotnet build
```
<!-- END_STEP -->
2. Run the Dotnet publisher app with Dapr:
1. Run the Dotnet publisher app with Dapr:

<!-- STEP
name: Run Dotnet publisher
Expand All @@ -82,11 +118,14 @@ sleep: 10
-->

```bash
dapr run --app-id checkout-sdk --resources-path ../../../components/ -- dotnet run --project .
cd ./checkout
dapr run --app-id checkout-sdk --resources-path ../../../components/ -- dotnet run
```

<!-- END_STEP -->

2. Stop and clean up application processes

```bash
dapr stop --app-id order-processor
dapr stop --app-id checkout-sdk
Expand Down
11 changes: 11 additions & 0 deletions pub_sub/csharp/sdk/dapr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1
common:
resourcesPath: ../../components/
apps:
- appID: order-processor
appDirPath: ./order-processor/
appPort: 7006
command: ["dotnet", "run"]
- appID: checkout-sdk
appDirPath: ./checkout/
command: ["dotnet", "run"]
61 changes: 60 additions & 1 deletion pub_sub/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,65 @@ This quickstart includes one publisher: Go client message generator `checkout`.

And one subscriber: Go subscriber `order-processor`.

## Run all apps with multi-app run template file:

This section shows how to run both 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 the multi app run template:

<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'Started Dapr with app id "order-processor-http"'
- 'Started Dapr with app id "checkout-http"'
- '== APP - checkout-http == Published data: {"orderId":1}'
- '== APP - order-processor-http == Subscriber received: map[orderId:1]'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->

```bash
dapr run -f .
```

The terminal console output should look similar to this:

```text
== APP - checkout-http == Published data: {"orderId":1}
== APP - order-processor-http == Subscriber received: {"orderId":1}
== APP - checkout-http == Published data: {"orderId":2}
== APP - order-processor-http == Subscriber received: {"orderId":2}
== APP - checkout-http == Published data: {"orderId":3}
== APP - order-processor-http == Subscriber received: {"orderId":3}
== APP - checkout-http == Published data: {"orderId":4}
== APP - order-processor-http == Subscriber received: {"orderId":4}
== APP - checkout-http == Published data: {"orderId":5}
== APP - order-processor-http == Subscriber received: {"orderId":5}
== APP - checkout-http == Published data: {"orderId":6}
== APP - order-processor-http == Subscriber received: {"orderId":6}
== APP - checkout-http == Published data: {"orderId":7}
== APP - order-processor-http == Subscriber received: {"orderId":7}
== APP - checkout-http == Published data: {"orderId":8}
== APP - order-processor-http == Subscriber received: {"orderId":8}
== APP - checkout-http == Published data: {"orderId":9}
== APP - order-processor-http == Subscriber received: {"orderId":9}
== APP - checkout-http == Published data: {"orderId":10}
== APP - order-processor-http == Subscriber received: {"orderId":10}
```

2. Stop and clean up application processes

```bash
dapr stop -f .
```
<!-- END_STEP -->

## 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.

### Run Go message subscriber with Dapr

1. Run the Go subscriber app with Dapr in the `order-processor` folder:
Expand All @@ -27,7 +86,7 @@ sleep: 15

```bash
cd ./order-processor
dapr run --app-port 6002 --app-id order-processor --app-protocol http --dapr-http-port 3501 --resources-path ../../../components -- go run .
dapr run --app-port 6003 --app-id order-processor --app-protocol http --dapr-http-port 3501 --resources-path ../../../components -- go run .
```

<!-- END_STEP -->
Expand Down
11 changes: 11 additions & 0 deletions pub_sub/go/http/dapr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1
common:
resourcesPath: ../../components/
apps:
- appID: order-processor-http
appDirPath: ./order-processor/
appPort: 6003
command: ["go", "run", "."]
- appID: checkout-http
appDirPath: ./checkout/
command: ["go", "run", "."]
Loading
Loading