Producer and consumer demo for daqing/moonkafka
Dependencies
docker compose -f docker-compose.kafka.yml up -ddocker exec moonkafka-demo-kafka /opt/kafka/bin/kafka-topics.sh \
--bootstrap-server localhost:9092 \
--create --if-not-exists \
--topic events \
--partitions 3 \
--replication-factor 1moon build --target nativemoon run --target native cmd/main -- consume eventsmoon run --target native cmd/main -- consume events kafka.example.com 9092 latestmoon run --target native cmd/main -- produce events "Hello from MoonBit" demo-keymoon run --target native cmd/main -- produce events "hello" demo-key kafka.example.com 9092make itestmake itest ITEST_FLAGS="--keep" # keep the container around for debugging
make itest ITEST_FLAGS="--dry-run" # print the commands that would run, without running them
make itest-plan # same as above
make itest ITEST_RUNTIME=podman # use podman instead (docker is the default)moon run --target native tests/itest -- --no-container --topic <existing-empty-topic>produce <topic> <value> [key] [host] [port]
consume <topic> [host] [port] [earliest|latest] [--max-messages <n>]moon run --target native cmd/main -- --helpdocker compose -f docker-compose.kafka.yml downInstall
Download zipProducer and consumer demo for daqing/moonkafka
Dependencies