eggjs kafka插件
- 待完善
Install
npm install egg-kafka --save
- config/config.{env}.js:
module { configkafka = client: host: 'localhost' // host port: '3306' // 端口号 app: true // 是否加载到 app 上,默认开启 agent: true // 是否加载到 agent 上,默认关闭 ; return config;}
API
Producer
example:
'use strict' module { //producer() optionl arguments true/false it`s aysnc/sync to create topics in kafka-node let createTopicsResult = thisappkafka // send create topics request to the kafka server , but there not anything response,why ? let sendResult = thisappkafka}
HighLevelProducer same as Producer
example:
'use strict' module { //producer() optionl arguments true/false it`s aysnc/sync to create topics in kafka-node let createTopicsResult = thisappkafka // send create topics request to the kafka server , but there not anything response,why ? let sendResult = thisappkafka}
-------------- 待完善 ----------------