🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more
Socket
Book a DemoInstallSign in
Socket

@blued-core/kafka-client

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blued-core/kafka-client

基于 kafka-node 的一层封装。

latest
npmnpm
Version
2.0.1
Version published
Maintainers
4
Created
Source

基于 kafka-node 的一层封装。

npm i @blued-core/kafka-client

cache 与 qconf-conf 组件都为可选的,可以自己根据描述自定义

使用方式:

import KafkaClient from '@blued-core/kafka-client'
import { QconfConf } from '@blued-core/qconf-conf'
import Cache from '@blued-core/cache'

async function main () {
  const qconfConf = new QconfConf({
    path: 'XXXX'
  })

  const kafkaClient = new KafkaClient(qconfConf, new Cache())

  const bootstrapKafka = kafkaClient.getClient('path')

  bootstrapKafka.send('topics', 'Hello World')
}

main()

API

send

参数类型是否必填描述
topicstring消息对应的 topic
messagestring消息体
optionsObject发送消息时的部分参数
options 结构描述
参数类型描述
keystringonly needed when using keyed partitioner
partitionnumber写入的分区
attributesnumber

FAQs

Package last updated on 07 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts