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

Update Python pub_sub sdk example #889

Merged
merged 1 commit into from
Sep 21, 2023
Merged
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
40 changes: 36 additions & 4 deletions pub_sub/python/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ And one subscriber:

### Run Python message subscriber with Dapr

1. Run the Python subscriber app (flask version) with Dapr:

<!-- STEP
name: run
-->
Expand All @@ -27,8 +29,6 @@ pip3 install -r requirements.txt

<!-- END_STEP -->

2. Run the Python subscriber app with Dapr:

<!-- STEP
name: Run python subscriber
expected_stdout_lines:
Expand All @@ -42,7 +42,38 @@ sleep: 10
-->

```bash
dapr run --app-id order-processor-sdk --resources-path ../../../components/ --app-port 6001 -- uvicorn app:app --port 6002
dapr run --app-id order-processor-sdk --resources-path ../../../components/ --app-port 6002 -- uvicorn app:app --port 6002
```

<!-- END_STEP -->

2. Run the Python subscriber app (fastapi version) with Dapr:

<!-- STEP
name: run
-->

```bash
cd ./order-processor-fastapi
pip3 install -r requirements.txt
```

<!-- END_STEP -->

<!-- STEP
name: Run python subscriber
expected_stdout_lines:
- '== APP == Subscriber received : 4'
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
working_dir: ./order-processor-fastapi
background: true
sleep: 10
-->

```bash
dapr run --app-id order-processor-sdk-fastapi --resources-path ../../../components/ --app-port 6003 -- uvicorn app:app --port 6003
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any app defined to run on port 6003; app.py in order-processor-fastapi should have app defined on port 6003.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any app defined to run on port 6003; app.py in order-processor-fastapi should have app defined on port 6003.

The port is defined by uvicorn app:app --port 6003 part.

```

<!-- END_STEP -->
Expand All @@ -61,7 +92,7 @@ pip3 install -r requirements.txt
```
<!-- END_STEP -->

3. Run the Python publisher app with Dapr:
2. Run the Python publisher app with Dapr:

<!-- STEP
name: Run python publisher
Expand All @@ -85,4 +116,5 @@ dapr run --app-id checkout-sdk --resources-path ../../../components/ -- python3
```bash
dapr stop --app-id checkout-sdk
dapr stop --app-id order-processor-sdk
dapr stop --app-id order-processor-sdk-fastapi
```