中间件是什么?
是一类提供系统软件和应用软件之间连接、便于软件各部件之间的沟通的软件,应用软件可以借助中间件在不同的技术架构之间共享信息与资源。中间件位于客户机服务器的操作系统之上,管理着计算资源和网络通信。
中间件就是一类为应用软件服务的软件,应用软件是为用户服务的,用户不会接触或者使用到中间件。
rabbitmq和erlang的关系?
RabbitMQ是一个由erlang开发的AMQP(Advanced Message Queue )的开源实现。
使用消息队列的好处?
下面三点好处:
- 通过异步处理提高系统性能(减少响应所需时间)
- 削峰/限流
- 降低系统耦合性。
MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息来通信,而无需专用连接来链接它们。消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信。
在数据量特别大的时候,消息队列的优势就体现了,小量数据体现不出(可以看参考1里的实验,有具体代码和时间比较)
简述broker,producer和consumer
RabbitMQ is a message broker: it accepts and forwards messages.
Producing means nothing more than sending. A program that sends messages is a producer
Consuming has a similar meaning to receiving. A consumer is a program that mostly waits to receive messages
Note that the producer, consumer, and broker do not have to reside on the same host; indeed in most applications they don’t. An application can be both a producer and consumer, too.
AMQP是什么?
AMQP(Advanced Message Queue ),一种协议。RabbitMQ是一个在AMQP基础上完成的,可复用的企业消息系统。
所以其内部实际上也是 AMQP 中的基本概念,包括:Message(消息)、Publisher(消息生产者),Exchange(交换器),Binding(绑定),Queue(消息队列),Connection(网络连接),Channel(信道),Consumer(消息消费者),Virtual Host(虚拟主机),Broker(消息队列服务器)。
rabbitmq的log里也有:
2023-05-15 07:15:07.410153+00:00 [info] <0.912.0> accepting AMQP connection <0.912.0> (172.17.0.1:57442 -> 172.17.0.3:5672)
2023-05-15 07:15:07.410375+00:00 [error] <0.912.0> closing AMQP connection <0.912.0> (172.17.0.1:57442 -> 172.17.0.3:5672):
RabbitMQ与python有什么常用的库?
pika
参考
https://blog.csdn.net/pig2guang/article/details/84382375
这个帖子说明了rabbitMQ的使用场景,java程序是producer,python脚本是consumer