MY_IP=your-ip docker-compose up -d
docker run --net=host --rm confluentinc/cp-kafka:3.0.1 kafka-topics --create --topic foo --partitions 4 --replication-factor 2 --if-not-exists --zookeeper 127.0.0.1:32181
kcat -C -b localhost:19092,localhost:29092,localhost:39092 -t foo -p 0
echo 'publish to partition 0' | kcat -P -b 0.0.0.0:19092,0.0.0.0:29092,0.0.0.0:39092 -t foo -p 0
cd worker && go run main.go
cd producer && go run main.go
curl --location 'http://localhost:8080/api/message' \
--header 'Content-Type: application/json' \
--data '{
"symbol": "VSL",
"val": 101
}'
Alternatively, you can run the python script which calls the above API
python3 producer.py