{"repo":"Byndyusoft/nest-kafka","free":true,"listed":false,"github":"https://github.com/Byndyusoft/nest-kafka","clone":"git clone https://github.com/Byndyusoft/nest-kafka.git","description":"Kafka for NestJS","language":"TypeScript","stars":27,"topics":["kafka","nodejs","typescript","nestjs"],"license":"Apache-2.0","category":"data-pipelines","readme_excerpt":"nest-kafka Kafka for NestJS Features - Multiple connections - Consumer and Producer with Schema Registry support (using kafkajs and @kafkajs/confluent-schema-registry under the hood) - Integration with nest-template - Consumer - Subscribe topic is not static, you can pick it from config - Process message in async context with Tracing and Logging - String, JSON and Schema Registry decoders for key and value, headers decoder with array support - Dead letter queue pattern support with smart retry mechanism - Support custom decoders and error handling patterns Requirements - Node.js v14 LTS or later - Yarn Install Usage Init 1. Create KafkaConfigDto 2. Add KafkaConfigDto into ConfigDto 3. Add env variables mapping 4. Import KafkaModule 4.1. You can describe multiple connections (farther use connectionName parameter in some functions to specify your connection) 4.2. If you want, you can not create consumer , producer or schemaRegistry 5. Connect microservice to start consuming messages Consuming Messages [!IMPORTANT] Put app.startAllMicroservices() after your app.listen(...) 1. Create controller and use KafkaConsumerEventPattern to describe consumer 2. Decode payload 2.1. You can use param decorators to get key, value or headers 3. Always use some exception filter for correct error handling 3.1. Use KafkaConsumerBaseExceptionFilter if you prefer Stop on error pattern 3.2. Use KafkaConsumerErrorTopicExceptionFilter if you prefer Dead letter queue pattern 3.3. KafkaConsumerErrorTopi","default_branch":null,"files":null,"tree":[],"storefront":"/r/Byndyusoft","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Byndyusoft/nest-kafka/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}