Venv
Create a new virtual environment in pyhon3.7
python3.7 -m venv .venv
Activate the virtual environment
source .venv/bin/activate
Start Kafka
- Start Kafka with Docker Compose:
docker-compose -f ./local-test-kafka.yml up -d
Run Python message subscriber with Dapr (Self Hosted Mode)
cd ./order-processor
pip3 install -r requirements.txt
- Run the Python subscriber app with Dapr:
dapr run --app-id order-processor-sdk --components-path ../components/ --app-port 6001 -- uvicorn app:app --port 6002
- To run with resiliency enabled (retry logic), run the following command:
dapr run --app-id order-processor-sdk --config ./config.yaml --components-path ../components/ --app-port 6001 -- uvicorn app:app --port 6002
Run Python message publisher with Dapr (Self Hosted Mode)
- Install dependencies:
cd ./checkout
pip3 install -r requirements.txt
- Run the Python publisher app with Dapr:
dapr run --app-id checkout-sdk --components-path ../components/ -- python3 app.py