Cerchie / event-sourcing-for-the-rest-of-us

Basically Kafka and Next.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To reproduce:

  1. Clone the repo.

1a. add a file .env in the root dir with values CONFLUENT_API_KEY and CONFLUENT_API_SECRET from a cloud env you've set up with a topic named 'test'

  1. npm install

  2. run npx next dev

  3. navigate to 'http://localhost:3000/event-sourced' in your browser

  4. View the error.

  5. Now, to try with Kafkajs, change line 2 in consumer.js to import { consumer } from "./workingwithkafka";

  6. Change line 2 in event-sourced/page.jsx to import { producer } from "../../workingwithkafka";

  7. Save the changes. Run Ctrl+C to stop the server, then npx next dev to re-run it.

  8. You should see the downstream error emanating from db.js, Error: Cannot read properties of undefined (reading '0'), which indicates that the app is past kafka errors. You can confirm that kafka is working here by viewing the messages in your 'test' topic

About

Basically Kafka and Next.js

License:MIT License


Languages

Language:JavaScript 100.0%