No description
- Python 77.5%
- Nix 11%
- Shell 7.6%
- Dockerfile 3.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| Dockerfile | ||
| env.sh | ||
| README.md | ||
| requirements.txt | ||
| saved_messages.json | ||
| shell.nix | ||
Bier in Aktion Producer
Setup
Nix
Just run nix-shell.
Linux
Create a python virtual environment and install the requirements:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Install protoc and generate the Protobuf classes:
./generate_classes.sh
Then load the config environment:
source env.sh
Windows
Use WSL2?
Config
Configuration is done with environment variables (see env.sh for default config).
The following variables are expected:
| Variable | Description | Example |
|---|---|---|
KAFKA_BROKER_URL |
Connection to Kafka broker | localhost:29092 |
KAFKA_TOPIC |
Kafka topic name | products |
API_CONFIGS |
JSON array of API configurations (URL, page size and Kafka topic) | [{"url": "https://api.example.com", "name": "api-1", "page_size": 10 }] |
SCHEMA_REGISTRY_URL |
URL to the schema registry | http://localhost:8081 |
Running
Execute the script with:
python3 src/main.py