Ack Nestjs Boilerplate Kafka

screenshot of Ack Nestjs Boilerplate Kafka
nestjs

Hybrid NestJs v9.x Boilerplate. Repository Design Pattern. Kafka Microservice. MongoDB(mongoose). Support Containerization.

Overview:

NestJs Boilerplate Ack KafkaNestJs Hybrid Http and NestJs Kafka Microservice is a boilerplate for NestJs applications that incorporates Kafka messaging. It provides a pre-configured setup for creating producers and consumers using NestJs and NestJs Microservice.

Features:

  • Global Module Import: The producer is always imported as a global module, allowing it to be accessed from any part of the application.
  • Message Offset Commit: Message offset is not committed in case of an error.
  • Optional Offset Commit: Optional offset commit is available during the first running of the application.
  • Default Kafka Configuration: The default Kafka topic is created with 3 partitions and 3 replication factors.
  • Sequential Guarantee: To ensure sequential processing of messages, a topic with 1 partition and 1 replication factor can be created.
  • Max InFlightRequests Setting: The maxInFlightRequests setting in the consumer config can be set to 1 for better performance.
  • Event Delivery Options: The boilerplate provides two options for event delivery - emit and send. The emit option immediately tries to deliver the event, while the send option requires explicit subscription before the message is sent.
  • Class-Validation Validation: All Kafka requests are validated using class-validation if the DTO class is set.
  • Kafka Controller Configuration: The KafkaController can be put into the kafka.router.module.ts file, allowing for easy on/off control using the env.KAFKA_CONSUMER_ENABLE environment variable.

Summary:

The NestJs Boilerplate Ack KafkaNestJs Hybrid Http and NestJs Kafka Microservice is a powerful boilerplate for NestJs applications. It provides pre-configured features for working with Kafka messaging, including global module import, offset commit options, sequential guarantee, and more. By following the installation guide, developers can easily set up their applications to leverage these Kafka-related features.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.