Skip to content

Instantly share code, notes, and snippets.

@un4ckn0wl3z
Created June 24, 2024 09:02
Show Gist options
  • Save un4ckn0wl3z/3f7de5a11a9701c34e2fbb6eb5ab03f8 to your computer and use it in GitHub Desktop.
Save un4ckn0wl3z/3f7de5a11a9701c34e2fbb6eb5ab03f8 to your computer and use it in GitHub Desktop.
kmonitor.ts
// kmonitor.ts
import { Injectable } from "@nestjs/common";
import { Ctx, KafkaContext } from "@nestjs/microservices";
@Injectable()
export class kMonitor {
constructor(@Ctx() context: KafkaContext) {
context.getConsumer().on('consumer.rebalancing', (ev) => {
console.log(ev)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment