kk-rocketmq
v1.1.0
Published
针对ali-ons的简单封装
Downloads
8
Readme
kk-rocketmq
针对ali-ons的简单封装
使用方法
producer
let res = await new Producer({
instanceName:'xxxx',
producerGroup:'xxx',
nameSrv: "xxx.xx.com",
}).sendMessage("topic","tag","body")
consumer
let consumer = new Consumer({
instanceName:'xxxx',
consumerGroup:'xxx',
nameSrv: "xxx.xx.com"
})
consumer.subscribe("topic","tag",async msg=>{
console.log(`receive message, msgId: ${msg.msgId}, body: ${msg.body.toString()}`)
})