mukundansundar / res-repro-kafka

Enabling resiliency with kafka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Venv

Create a new virtual environment in pyhon3.7

python3.7 -m venv .venv

Activate the virtual environment

source .venv/bin/activate

Start Kafka

  1. 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
  1. 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
  1. 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)

  1. Install dependencies:
cd ./checkout
pip3 install -r requirements.txt
  1. Run the Python publisher app with Dapr:
dapr run --app-id checkout-sdk --components-path ../components/ -- python3 app.py

About

Enabling resiliency with kafka


Languages

Language:Python 100.0%