1. Python
  2. Tutorial

Produce Messages

Make the producer.py file executable by running the following command:

chmod +x producer.py

Run the producer by executing the following command:

./producer.py

You should see output resembling this:

Produced event to topic purchases: key = jbernard     value = alarm clock
Produced event to topic purchases: key = eabara       value = gift card
Produced event to topic purchases: key = jsmith       value = batteries
Produced event to topic purchases: key = sgarcia      value = alarm clock
Produced event to topic purchases: key = jsmith       value = book
Produced event to topic purchases: key = sgarcia      value = alarm clock
Produced event to topic purchases: key = awalther     value = batteries
Produced event to topic purchases: key = awalther     value = gift card
Produced event to topic purchases: key = awalther     value = book
Produced event to topic purchases: key = htanaka      value = book
Previous
Build Consumer