Watch a Kafka system
In this tutorial, you start a small order system that uses a real broker. The broker is Redpanda, which uses the Kafka protocol. You follow one order across its topics. Then you start a fault and see it on the timeline.
You need Docker and Git. You do not need to install streamview or Node.js.
1. Start the example
Section titled “1. Start the example”Get the streamview source code, and start the example:
git clone https://github.com/event-catalog/streamviewcd streamview/exampledocker compose up -d --buildThe first build takes some minutes. The command starts a broker, six services, and streamview.
2. Open the page
Section titled “2. Open the page”Open http://localhost:4747 in your browser.
You see one lane for each topic, for example orders.placed and payments.captured.
The six services send messages only through these topics.
3. Follow one order
Section titled “3. Follow one order”- Click the time range button at the top right. Then click Last 30 s.
- Drag across approximately three seconds of the timeline. Each event is now one thin mark.
- Click a mark in the
orders.placedlane.
The panel opens. The trace shows the events of this order in the other topics. The value next to each step is the time after the first event.
The services send plain JSON messages, not CloudEvents.
streamview connects the messages with the orderId field of each message.
4. Start a payment outage
Section titled “4. Start a payment outage”- Press Escape to close the panel.
- Click Live. The view follows the current time again.
- Run this command in a terminal:
curl -X POST 'localhost:18081/chaos/outage?seconds=60'- Look at the
payments.authorizedlane and thepayments.capturedlane for two minutes.
For 60 seconds, the payments service cannot get an answer from its payment gateway.
The two lanes become empty, but orders.placed continues.
When the outage ends, the two lanes show a burst, because the payments service handles the orders that waited.
5. Start a bad release
Section titled “5. Start a bad release”- Run this command:
curl -X POST 'localhost:18080/chaos/bad-deploy?seconds=45'- Look at the
orders.placedlane.
For 45 seconds, the orders service sends total as text.
streamview shows these events in amber, because their shape is different from the usual shape.
- Click an amber mark.
The panel shows the label Shape drift and the field that is different.
6. Stop the example
Section titled “6. Stop the example”Run this command in the example directory:
docker compose down -vThe command stops the containers and deletes their data.
What you did
Section titled “What you did”You saw a real Kafka system on the timeline, followed one order, and saw two faults when they occurred.
Next steps:
- Connect to Kafka, to see your own topics.
- How streamview reads without taking messages.