Skip to content

Commit

Permalink
feat: use nestjs-pino fork
Browse files Browse the repository at this point in the history
BREAKING CHANGE: use @byndyusoft/nest-pino instead of nestjs-pino
KillWolfVlad committed Jan 26, 2023
1 parent 89751db commit 035ed3f
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ Kafka for NestJS
- Integration with [nest-template](https://github.com/Byndyusoft/nest-template)
- Consumer
- Subscribe topic is not static, you can pick it from config
- Process message in async context with [Tracing](https://www.npmjs.com/package/@byndyusoft/nest-opentracing) and [Logging](https://www.npmjs.com/package/nestjs-pino)
- Process message in async context with [Tracing](https://www.npmjs.com/package/@byndyusoft/nest-opentracing) and [Logging](https://www.npmjs.com/package/@byndyusoft/nest-pino)
- String, JSON and Schema Registry decoders for key and value, headers decoder with array support
- [Dead letter queue](https://www.confluent.io/blog/error-handling-patterns-in-kafka/#pattern-2) pattern support with smart retry mechanism
- Support custom decoders and error handling patterns
@@ -27,7 +27,7 @@ Kafka for NestJS
## Install

```bash
yarn add @byndyusoft/nest-kafka @byndyusoft/class-validator-extended @byndyusoft/nest-opentracing @kafkajs/confluent-schema-registry @nestjs/common @nestjs/microservices class-transformer class-validator kafkajs nestjs-pino rxjs
yarn add @byndyusoft/nest-kafka @byndyusoft/class-validator-extended @byndyusoft/nest-opentracing @byndyusoft/nest-pino @kafkajs/confluent-schema-registry @nestjs/common @nestjs/microservices class-transformer class-validator kafkajs rxjs
```

## Usage
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@
"@byndyusoft/class-validator-extended": "1.0.1",
"@byndyusoft/eslint-config": "2.2.1",
"@byndyusoft/nest-opentracing": "2.3.2",
"@byndyusoft/nest-pino": "3.1.2-1",
"@byndyusoft/tsconfig": "1.2.0",
"@commitlint/cli": "17.4.1",
"@commitlint/config-conventional": "17.4.0",
@@ -96,7 +97,6 @@
"kafkajs": "2.2.3",
"lint-staged": "13.1.0",
"markdownlint-cli": "0.33.0",
"nestjs-pino": "3.1.2",
"pino": "8.8.0",
"pinst": "3.0.0",
"prettier": "2.8.2",
@@ -112,13 +112,13 @@
"peerDependencies": {
"@byndyusoft/class-validator-extended": "^1.0.1",
"@byndyusoft/nest-opentracing": "^2.3.2",
"@byndyusoft/nest-pino": "^3.1.2-1",
"@kafkajs/confluent-schema-registry": "^3.3.0",
"@nestjs/common": "^8.0.0 || ^9.0.0",
"@nestjs/microservices": "^8.0.0 || ^9.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"kafkajs": "^2.2.3",
"nestjs-pino": "^3.1.2",
"rxjs": "^7.8.0"
},
"packageManager": "[email protected]",
4 changes: 2 additions & 2 deletions src/consumer/kafkaConsumerMessageHandler.ts
Original file line number Diff line number Diff line change
@@ -16,11 +16,11 @@

import { TracingService } from "@byndyusoft/nest-opentracing";
import { AsyncContext as TracingAsyncContext } from "@byndyusoft/nest-opentracing/dist/async-context";
import { PinoLogger } from "@byndyusoft/nest-pino";
import { storage as loggerStorage, Store } from "@byndyusoft/nest-pino/storage";
import { Inject, Injectable } from "@nestjs/common";
import { MessageHandler } from "@nestjs/microservices";
import { EachMessagePayload } from "kafkajs";
import { PinoLogger } from "nestjs-pino";
import { storage as loggerStorage, Store } from "nestjs-pino/storage";
import retry from "retry";
import { isObservable, lastValueFrom } from "rxjs";

2 changes: 1 addition & 1 deletion src/consumer/kafkaConsumerMessageHandlerLogger.ts
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@
*/

import { Tags, TracingService } from "@byndyusoft/nest-opentracing";
import { PinoLogger } from "@byndyusoft/nest-pino";
import { Injectable, LoggerService } from "@nestjs/common";
import { PinoLogger } from "nestjs-pino";

import { getErrorCause, serializeError } from "./errors";

24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -490,6 +490,7 @@ __metadata:
"@byndyusoft/eslint-config": "npm:2.2.1"
"@byndyusoft/nest-dynamic-module": "npm:^1.0.0"
"@byndyusoft/nest-opentracing": "npm:2.3.2"
"@byndyusoft/nest-pino": "npm:3.1.2-1"
"@byndyusoft/tsconfig": "npm:1.2.0"
"@commitlint/cli": "npm:17.4.1"
"@commitlint/config-conventional": "npm:17.4.0"
@@ -513,7 +514,6 @@ __metadata:
lint-staged: "npm:13.1.0"
lodash: "npm:^4.17.21"
markdownlint-cli: "npm:0.33.0"
nestjs-pino: "npm:3.1.2"
pino: "npm:8.8.0"
pinst: "npm:3.0.0"
prettier: "npm:2.8.2"
@@ -530,13 +530,13 @@ __metadata:
peerDependencies:
"@byndyusoft/class-validator-extended": ^1.0.1
"@byndyusoft/nest-opentracing": ^2.3.2
"@byndyusoft/nest-pino": ^3.1.2-1
"@kafkajs/confluent-schema-registry": ^3.3.0
"@nestjs/common": ^8.0.0 || ^9.0.0
"@nestjs/microservices": ^8.0.0 || ^9.0.0
class-transformer: ^0.5.1
class-validator: ^0.14.0
kafkajs: ^2.2.3
nestjs-pino: ^3.1.2
rxjs: ^7.8.0
languageName: unknown
linkType: soft
@@ -559,6 +559,16 @@ __metadata:
languageName: node
linkType: hard

"@byndyusoft/nest-pino@npm:3.1.2-1":
version: 3.1.2-1
resolution: "@byndyusoft/nest-pino@npm:3.1.2-1"
peerDependencies:
"@nestjs/common": ^8.0.0 || ^9.0.0
pino-http: ^6.4.0 || ^7.0.0 || ^8.0.0
checksum: d5d82d3cbba0a617c21f88670aaf6eb0a399793b19ca73e8beb36f4f97b766a2a28fafb67c89e0343b27bc99e92333bf2762303a330403587b82ccac2aed7d19
languageName: node
linkType: hard

"@byndyusoft/tsconfig@npm:1.2.0":
version: 1.2.0
resolution: "@byndyusoft/tsconfig@npm:1.2.0"
@@ -7469,16 +7479,6 @@ __metadata:
languageName: node
linkType: hard

"nestjs-pino@npm:3.1.2":
version: 3.1.2
resolution: "nestjs-pino@npm:3.1.2"
peerDependencies:
"@nestjs/common": ^8.0.0 || ^9.0.0
pino-http: ^6.4.0 || ^7.0.0 || ^8.0.0
checksum: 9a8392e491c076393ca9d07137b3459bff9a5de040aefcb1913c39fe3f69f8147523ae8150a938bf6ef4bc2e5f69f42116f95cf95ed97891bc0f2f94715cc806
languageName: node
linkType: hard

"node-emoji@npm:^1.11.0":
version: 1.11.0
resolution: "node-emoji@npm:1.11.0"

0 comments on commit 035ed3f

Please sign in to comment.