No description
  • Python 77.5%
  • Nix 11%
  • Shell 7.6%
  • Dockerfile 3.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alex Leidwein 8aba47b6cc
All checks were successful
/ build (push) Successful in 22s
fix: Dockerfile
2024-05-06 10:42:06 +02:00
.forgejo/workflows ci: fix workflow path 2024-05-05 17:09:23 +02:00
src feat!: use avro, add mock data 2024-04-07 14:13:30 +02:00
.dockerignore ci: added workflow 2024-05-05 17:07:41 +02:00
.gitignore feat!: use schema registry and protobuf 2024-03-10 15:43:59 +01:00
Dockerfile fix: Dockerfile 2024-05-06 10:42:06 +02:00
env.sh feat!: use schema registry and protobuf 2024-03-10 15:43:59 +01:00
README.md feat!: use schema registry and protobuf 2024-03-10 15:43:59 +01:00
requirements.txt feat!: use avro, add mock data 2024-04-07 14:13:30 +02:00
saved_messages.json feat!: use avro, add mock data 2024-04-07 14:13:30 +02:00
shell.nix ci: added workflow 2024-05-05 17:07:41 +02:00

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