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

Java workflow quickstart #925

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/holopin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
organization: dapr
defaultSticker: clmjkxscc122740fl0mkmb7egi
stickers:
-
id: clmjkxscc122740fl0mkmb7egi
alias: ghc2023
1 change: 1 addition & 0 deletions .github/workflows/validate_python_quicstarts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
pip3 install setuptools wheel
pip3 install mechanical-markdown
pip3 install fastapi uvicorn
- name: Validate building blocks with Python
run: |
variants=("http" "sdk")
Expand Down
2 changes: 1 addition & 1 deletion actors/csharp/sdk/client/SmartDevice.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.10.0" />
<PackageReference Include="Dapr.Actors" Version="1.12.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion actors/csharp/sdk/interfaces/SmartDevice.Interfaces.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.10.0" />
<PackageReference Include="Dapr.Actors" Version="1.12.*-*" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions actors/csharp/sdk/service/SmartDevice.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.10.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.10.0" />
<PackageReference Include="Dapr.Actors" Version="1.12.*-*" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.12.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion bindings/csharp/sdk/batch/batch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Dapr.AspNetCore" Version="1.11.*-*" />
<PackageReference Include="Dapr.AspNetCore" Version="1.12.*-*" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion configuration/csharp/sdk/order-processor/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.11.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.12.*-*" />
</ItemGroup>

</Project>
107 changes: 58 additions & 49 deletions pub_sub/csharp/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,87 @@ And one subscriber:

- Dotnet subscriber `order-processor`

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

1. Navigate to the directory and install dependencies:
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.

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

```bash
cd ./order-processor
dotnet restore
dotnet build
```
<!-- END_STEP -->
2. Run the Dotnet subscriber app with Dapr:
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: Run Dotnet subscriber
name: Run multi app run template
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Subscriber received : 2'
- "Exited Dapr successfully"
- "Exited App successfully"
- 'Started Dapr with app id "order-processor-http"'
- 'Started Dapr with app id "checkout-http"'
- '== APP - checkout-http == Published data: Order { OrderId = 2 }'
- '== APP - order-processor-http == Subscriber received : 2'
expected_stderr_lines:
working_dir: ./order-processor
output_match_mode: substring
match_order: none
background: true
sleep: 10
sleep: 15
timeout_seconds: 45
-->


```bash
dapr run --app-id order-processor-http --resources-path ../../../components/ --app-port 7005 -- dotnet run --project .
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 -->
### Run Dotnet message publisher with Dapr

1. Navigate to the directory and install dependencies:
## Run a single app at a time with Dapr (Optional)

<!-- STEP
name: Install Dotnet dependencies
-->
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:

```bash
cd ./checkout
dotnet restore
dotnet build
cd ./order-processor
dapr run --app-id order-processor-http --resources-path ../../../components/ --app-port 7005 -- dotnet run
```
<!-- END_STEP -->
2. Run the Dotnet publisher app with Dapr:

<!-- STEP
name: Run Dotnet publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: Order { OrderId = 1 }'
- '== APP == Published data: Order { OrderId = 2 }'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
working_dir: ./checkout
output_match_mode: substring
background: true
sleep: 10
-->

### Run Dotnet message publisher with Dapr

1. Run the Dotnet publisher app with Dapr:


```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
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"]
107 changes: 58 additions & 49 deletions pub_sub/csharp/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,87 @@ And one subscriber:

- Dotnet subscriber `order-processor`

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

1. Navigate to the directory and install dependencies:
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.

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

```bash
cd ./order-processor
dotnet restore
dotnet build
```
<!-- END_STEP -->
2. Run the Dotnet subscriber app with Dapr:
1. Open a new terminal window and run the multi app run template:

<!-- STEP
name: Run Dotnet subscriber
name: Run multi app run template
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Subscriber received : Order { OrderId = 2 }'
- "Exited Dapr successfully"
- "Exited App successfully"
- 'Started Dapr with app id "order-processor"'
- 'Started Dapr with app id "checkout-sdk"'
- 'Published data: Order { OrderId = 2 }'
- 'Subscriber received : Order { OrderId = 2 }'
expected_stderr_lines:
working_dir: ./order-processor
output_match_mode: substring
match_order: none
background: true
sleep: 10
sleep: 15
timeout_seconds: 60
-->


```bash
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 7006 -- dotnet run --project .
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 -->
### Run Dotnet message publisher with Dapr

1. Navigate to the directory and install dependencies:
## Run a single app at a time with Dapr (Optional)

<!-- STEP
name: Install Dotnet dependencies
-->
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:

```bash
cd ./checkout
dotnet restore
dotnet build
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 7006 -- dotnet run
```
<!-- END_STEP -->
2. Run the Dotnet publisher app with Dapr:

<!-- STEP
name: Run Dotnet publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: Order { OrderId = 1 }'
- '== APP == Published data: Order { OrderId = 2 }'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
working_dir: ./checkout
output_match_mode: substring
background: true
sleep: 10
-->

### Run Dotnet message publisher with Dapr

1. Run the Dotnet publisher app with Dapr:


```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
Expand Down
2 changes: 1 addition & 1 deletion pub_sub/csharp/sdk/checkout/checkout.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.11.*-*" />
<PackageReference Include="Dapr.AspNetCore" Version="1.12.*-*" />
</ItemGroup>

</Project>
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"]
2 changes: 1 addition & 1 deletion pub_sub/csharp/sdk/order-processor/order-processor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Dapr.AspNetCore" Version="1.11.*-*" />
<PackageReference Include="Dapr.AspNetCore" Version="1.12.*-*" />
</ItemGroup>

</Project>
Loading
Loading