MQ:Message Queue,消息队列。
RabbitMQ Server:
RabbitMQ和NodeJS怎么融合一起:
使用 nodejs 快速搭建 MQTT 服务器及实时推送、获取数据(Nodejs MQtt):https://blog.csdn.net/twodogya/article/details/103395588
架构设计之NodeJS操作消息队列RabbitMQ:https://www.cnblogs.com/wukong-holmes/p/9306733.html
1. 什么是消息?
消息(Message)是指在应用间传送的数据。消息可以非常简单,比如只包含文本字符串,也可以更复杂,可能包含嵌入对象。
2. 什么是消息队列?
消息队列(Message Queue)是一种应用间的通信方式,消息发送后可以立即返回,由消息系统来确保消息的可靠传递。消息发布者只管把消息发布到 MQ 中而不用管谁来取,消息使用者只管从 MQ 中取消息而不管是谁发布的。这样发布者和使用者都不用知道对方的存在。
3. 常用的消息队列
RabbitMQ、RocketMQ、ActiveMQ、Kafka、ZeroMQ、MetaMq。
4. 消息队列应用场景
异步处理 应用解耦 流量削峰
5. 应用案例
日志系统是怎么实现的呢?
(1)生产者
向消息队列中写入消息
(2)消费者
从消息队列中读取消息
6. 代码
(1)写入消息
sendQueueMsg(queueName, msg, errCallBack){
}
(2)接收消息
什么时候接收呢?
定时去取?还是被动的等待消息到来?
5672端口:MQ?
Error: connect ECONNREFUSED 127.0.0.1:5672 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16):https://blog.csdn.net/weixin_34362875/article/details/93469755
生产者与消费者之间不直接通信。。而是通过Server中间服务器。Server一般是和生产者是同一台电脑吗?
RabbitMQ安装:https://blog.csdn.net/zhm3023/article/details/82217222
The exception seems to be caused by your queue not being declared (as the error message describes 404 - the queue 'action' was not found). The reason why the example works for the original poster is probably because he already has declared the queue earlier, without realizing that it's missing in his example.
You can declare the queue by calling ->declare() on the queue object. You'll also have to do this with the exchange object, unless you're certain that it already exists when you attempt to hook the queue onto it.
UPDATE:
You are right, thanks. I originally used a php library instead of the native extension, by default that library made the queue if it were not declare already.
Subscribing no existing QUEUE (connection_closed_abruptly):https://github.com/squaremo/amqp.node/issues/175
订阅一个不存在的序列时连接会关闭:
可以使用assertqueue先确认一下队列是否存在,如果存在再进行下一步:http://www.voidcn.com/article/p-fnnfuywc-bwh.html
rabbitmq死信队列如何重启: