CREATE AN OEH CLUSTER
Documentation here or watch following video:
When the cluster is created, go to details page and grab the connection url, which has the format <broker1_ip>:6667,…,<brokern_ip>:6667
CREATE A TOPIC
INSTALL THE LIB
I’ve done the following (Mac):
git clone https://github.com/edenhill/librdkafka.git cd librdkafka ./configure --prefix /usr/local make sudo make install (sudo make uninstall in case you want to remove the lib) brew install librdkafka
BUILD OR GRAB A SAMPLE CLIENT
I’ve downloaded this consumer and this producer samples. Create producer.go and consumer.go files and put the sample code in each file.
go build producer.go go build consumer.go
Test your clients:
./producer <broker1_ip>:6667,...,<brokern_ip>:6667 sample ./consumer <broker1_ip>:6667,...,<brokern_ip>:6667 consumer_example sample
That’s all folks!
🙂 Enjoy