1. C & C++
  2. Tutorial

Produce Messages

If you are using a Mac, please export the following environment variable:

export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"

Build and make the producer executable by running the following command:

make producer
./producer

You should see output resembling this:

** Message: 20:20:47.435: Produced event to topic purchases: key =       jsmith value =  alarm clock
** Message: 20:20:47.439: Produced event to topic purchases: key =     jbernard value =         book
** Message: 20:20:47.439: Produced event to topic purchases: key =     awalther value =         book
** Message: 20:20:47.439: Produced event to topic purchases: key =      htanaka value =     t-shirts
** Message: 20:20:47.439: Produced event to topic purchases: key =     jbernard value =  alarm clock
** Message: 20:20:47.439: Produced event to topic purchases: key =      sgarcia value =     t-shirts
** Message: 20:20:47.439: Produced event to topic purchases: key =      sgarcia value =    batteries
** Message: 20:20:47.439: Produced event to topic purchases: key =     awalther value =  alarm clock
** Message: 20:20:47.439: Produced event to topic purchases: key =       eabara value =  alarm clock
** Message: 20:20:47.439: Produced event to topic purchases: key =      htanaka value =  alarm clock
** Message: 20:20:47.439: Flushing final messages..
** Message: 20:20:49.032: 10 events were produced to topic purchases.
Previous
Build Consumer