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

pub_sub example with FastAPI #4390

Closed
ya-boiko opened this issue Oct 14, 2024 · 1 comment
Closed

pub_sub example with FastAPI #4390

ya-boiko opened this issue Oct 14, 2024 · 1 comment
Labels
content/incorrect-information Content in the docs is incorrect

Comments

@ya-boiko
Copy link

Describe the issue
The code sample with FastAPI (/quickstarts/pub_sub/python/sdk/order-processor-fastapi) doesn't work quite right (maybe it's just me). Order-processor-sdk and checkout-sdk start, but order-processor-sdk doesn't accept messages. The Flask example works correctly

URL of the docs
quickstarts/pubsub-quickstart

Expected content
dapr.yaml

version: 1
common:
  resourcesPath: ../../components/
apps:
  - appID: order-processor-sdk
    appDirPath: ./order-processor-fastapi/
    appPort: 6001
    command: ["uvicorn", "app:app"]
  - appID: checkout-sdk
    appDirPath: ./checkout/
    command: ["python3", "app.py"]

Screenshots
image

@ya-boiko ya-boiko added the content/incorrect-information Content in the docs is incorrect label Oct 14, 2024
@ya-boiko
Copy link
Author

The solution is to change the order-processor-sdk port from 6001 to 8000 and update the commands for both apps

version: 1
common:
  resourcesPath: ../../components/
apps:
  - appID: order-processor-sdk
    appDirPath: ./order-processor-fastapi/
    appPort: 8000
    command: ["/bin/bash", "-c", "source .venv/bin/activate && uvicorn app:app"]
  - appID: checkout-sdk
    appDirPath: ./checkout/
    command: ["/bin/bash", "-c", "source .venv/bin/activate && python3 app.py"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content/incorrect-information Content in the docs is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant