码迷,mamicode.com
首页 > 其他好文 > 详细

简单的RabbitMQ

时间:2018-11-23 21:01:43      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:rabbit   targe   cal   http   api   target   sse   class   doc   

// send
let amqp = require(amqplib)
let conn = amqp.connect(amqp://localhost)
let channel = createChannel()
channel.assertQueue(haha)
channel.sendToQueue(heihei, msg)
channel.close()
// receive
let amqp = require(amqplib)
let conn = amqp.connect(amqp://localhost)
let channel = conn.createChannel()
channel.assertQueue(haha)
channel.consume(heihei, msg => {
    // do something
    channel.ack(msg)
})
The official documentation is here

简单的RabbitMQ

标签:rabbit   targe   cal   http   api   target   sse   class   doc   

原文地址:https://www.cnblogs.com/liqunblog/p/10008951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!