Make the consumer.py file executable by running the following command:
Copy
Ask AI
chmod +x consumer.py
Run the consumer by executing the following command:
Copy
Ask AI
./consumer.py
You should see output resembling this:
Copy
Ask AI
Consumed event from topic purchases: key = awalther value = batteriesConsumed event from topic purchases: key = awalther value = gift cardConsumed event from topic purchases: key = awalther value = bookConsumed event from topic purchases: key = htanaka value = bookConsumed event from topic purchases: key = jbernard value = alarm clockConsumed event from topic purchases: key = eabara value = gift cardConsumed event from topic purchases: key = jsmith value = batteriesConsumed event from topic purchases: key = sgarcia value = alarm clockConsumed event from topic purchases: key = jsmith value = bookConsumed event from topic purchases: key = sgarcia value = alarm clock
Enter Ctrl-C to terminate the consumer application.