@monvechen/kafka-easy
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

kafka-easy

About the Project

easy use for kafkajs

Usage

import { KafkaEasy } from './utils/KafkaEasy'

const kafka = new KafkaEasy({
  clientId: 'my-app',
  brokers: [
    "lzb-kafka.dibiaozuitu.com:9092"
  ],
  retry: {
    retries: 8
  }
}, 'topic')

#producer send msg
kafka.send([{ value: '1' }])

#consumer subscribe
kafka.subscribe((msg)=>{
  console.log(msg);
})

Readme

Keywords

Package Sidebar

Install

npm i @monvechen/kafka-easy

Weekly Downloads

1

Version

1.0.5

License

Apache-2.0

Unpacked Size

18.5 kB

Total Files

7

Last publish

Collaborators

  • monvechen