Hybrid NestJs v9.x Boilerplate. Repository Design Pattern. Kafka Microservice. MongoDB(mongoose). Support Containerization.
NestJs Hybrid Http and NestJs Kafka Microservice.
Fork from ack-nestjs-boilerplate
Before run, you must to create the topics with kafka-topics cli
. Or you can run yarn kafka:create-topics
. (Point 9 at Behaviour)
nestjs/microservice
1 partition
and 1 replication factor
maxInFlightRequests
to 1
in consumer configproducerSendSequential
or produceEmitSequential
emit
means that whether or not you explicitly subscribe to the observable, the proxy will immediately try to deliver the event.send
means that you have to explicitly subscribe to it before the message will be sent.acks
will depends on kafka setting. Unfortunately, nestjs can not set acks when produce some message../src/kafka/constants/kafka.topic.constant.ts
must created before running.class-validation
if you set the dto class../src/kafka/router/kafka.router.module.ts
, so you can use env.KAFKA_CONSUMER_ENABLE
for on/off