1. C & C++
  2. Tutorial

Consume Messages

Make the consumer executable and run it:

make consumer
./consumer

You should see output resembling this:

** Message: 20:22:48.849: Consumed event from topic purchases: key = eabara value = batteries
** Message: 20:22:48.849: Consumed event from topic purchases: key = jbernard value = t-shirts
** Message: 20:22:48.849: Consumed event from topic purchases: key = eabara value = gift card
** Message: 20:22:48.849: Consumed event from topic purchases: key = jbernard value = batteries
** Message: 20:22:48.849: Consumed event from topic purchases: key = eabara value = alarm clock
** Message: 20:22:48.849: Consumed event from topic purchases: key = eabara value = t-shirts
** Message: 20:22:48.849: Consumed event from topic purchases: key = awalther value = alarm clock
** Message: 20:22:48.849: Consumed event from topic purchases: key = htanaka value = gift card
** Message: 20:22:48.849: Consumed event from topic purchases: key = awalther value = gift card
** Message: 20:22:48.849: Consumed event from topic purchases: key = sgarcia value = alarm clock
** Message: 20:22:48.849: Consumed event from topic purchases: key = jsmith value = alarm clock
** Message: 20:22:48.849: Consumed event from topic purchases: key = sgarcia value = book
** Message: 20:22:48.849: Consumed event from topic purchases: key = jsmith value = alarm clock
** Message: 20:22:48.849: Consumed event from topic purchases: key = sgarcia value = t-shirts
** Message: 20:22:48.849: Consumed event from topic purchases: key = sgarcia value = batteries

Rerun the producer to see more events, or feel free to modify the code as necessary to create more or different events.

Once you are done, enter Ctrl-C to terminate the consumer application.

Previous
Produce Messages