This adds a Kafka Tranport plugin for Grav, very similar to the NATS plugin.
To test, first start a Redpanda container (a Kafka-compatible broker):
docker run -p 9092:9092 -p 9644:9644 docker.vectorized.io/vectorized/redpanda:latest redpanda start
Then, shell in and create a topic:
docker ps (copy the ID of the redpanda container)
docker exec -it {container id} /bin/bash
(you're in the container's shell now)
rpk topic create grav.default --brokers=localhost:9092exit
Now you can run the tester:
go run ./transport/kafka/tester/main.go
(open a second shell)
go run ./transport/kafka/tester/main.go
You'll see two messages sent 5 seconds apart from each one and show up in the other:
sending 1
{"log_message":"(D) [bridge-kafka] recieved message via grav.default","timestamp":"2021-11-09T21:02:39.691233-05:00","level":4}
sending 2
{"log_message":"(D) [bridge-kafka] recieved message via grav.default","timestamp":"2021-11-09T21:02:44.68995-05:00","level":4}
{"log_message":"(D) [bridge-kafka] recieved message via grav.default","timestamp":"2021-11-09T21:03:26.198141-05:00","level":4}
received something: world grav.default
{"log_message":"(D) [bridge-kafka] recieved message via grav.default","timestamp":"2021-11-09T21:03:31.197518-05:00","level":4}
received something: again grav.default
This adds a Kafka Tranport plugin for Grav, very similar to the NATS plugin.
To test, first start a Redpanda container (a Kafka-compatible broker):
docker run -p 9092:9092 -p 9644:9644 docker.vectorized.io/vectorized/redpanda:latest redpanda start
Then, shell in and create a topic:
docker ps
(copy the ID of the redpanda container)docker exec -it {container id} /bin/bash
(you're in the container's shell now)rpk topic create grav.default --brokers=localhost:9092
exit
Now you can run the tester:
go run ./transport/kafka/tester/main.go
(open a second shell)go run ./transport/kafka/tester/main.go
You'll see two messages sent 5 seconds apart from each one and show up in the other: