Quick up and running using Go for Apache Kafka
Use Vagrant to get up and running.
- Install Vagrant http://www.vagrantup.com/
- Install Virtual Box https://www.virtualbox.org/
In the main kafka folder
- vagrant up
- vagrant ssh brokerOne
- cd /vagrant
- sudo ./test.sh
once this is done
- Zookeeper will be running 192.168.86.5
- Broker 1 on 192.168.86.10
- All the tests in github.com/stealthly/go-kafka/test/* should pass
You can access the brokers and zookeeper by their IP from your local without having to go into vm.
e.g.
bin/kafka-console-producer.sh --broker-list 192.168.86.10:9092 --topic get this from the random topic created in test
bin/kafka-console-consumer.sh --zookeeper 192.168.86.5:2181 --topic get this from the random topic created in test --from-beginning
If there is an API break, godep
provides facilities for building and running the provided dependency snapshot (godep save
). To leverage this, simply prepend all go commands with godep
to run them inside a sandbox. Example:
# Run Go ping-pong client
godep go run scala_go_kafka.go go-topic scala-topic