Skip to content

medinamarquezp/nestjs-kafka

Repository files navigation

NestJS framework with KafkaJS

Base integration of KafkaJS in NestJS framework.

In order to run Kafka locally I will be using Kafdrop with Docker. Kafdrop is a web UI for viewing Kafka topics and browsing consumer groups. The tool displays information such as brokers, topics, partitions, consumers, and lets you view messages.

Installing Docker and Kafdrop

Configuring Kafka in your NestJS application

  • Copy the example.env file in the root folder of your project and rename it like .env cp example.env .env.
  • Open .env file, uncomment KAFKA_BROKER_URL line and put the URL of your Kafka broker (if you are using base configuration of Kafdrop, localhost:9092)

Test implementation

  • Install project dependencies if you have not done it yet: npm install
  • Start your dev environment: npm run start:dev
  • Navigate to localhost:3000
  • Once the api has responded, you should see in the terminal the result of the test consumer implementation.

About

Base integration of KafkaJS in NestJS framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published