Skip to content

Latest commit

 

History

History

kafka-c-getting-started

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Apache Kafka C/C++

install perequisites

install gcc

sudo apt-get install gcc

install librdkafka

sudo apt-get install librdkafka

install pkg-config

sudo apt-get install pkg-config

install glib

sudo apt-get install -y libglib2.0-dev

Create project

create a new Makefile

create a common c file will be usded by producer and consumer common.c

Configuration

rename config file getting_started-template.ini to getting_started.ini

replace below values with yours:

  • bootstrap.servers
  • CLUSTER API KEY
  • cluster API SECRET

Build Producer

create a producer file producer.c

Build Consumer

create a consumer file consumer.c

Produce Events

Compile producer file

make producer 

Run producer program with config file

./producer getting-started.ini

Consume Events

Compile consumer file

make consumer

Run consumer program with config file

./consumer getting-started.ini