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

kgp.png

goc

That’s all folks!

🙂 Enjoy

 

Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.