-
The role and usage scenarios of message queues
Key points: keywords + application scenarios -
What is the role of Channel and vhost
Channel: Reduce the consumption of TCP resources. It is also the most important programming interface.
Vhost: Improve hardware resource utilization and achieve resource isolation. -
What are the routing methods for RabbitMQ's messages? What business scenario is it suitable for?
Direct, Topic, Fanout -
What is the binding relationship between switch and queue, queue and consumer?
-
Where did the unrouted message go?
- Discard directly.
- The backup switch (alternate-exchange) receives.
-
When will the message become a Dead Letter?
- Message expired;
- The message exceeds the queue length or capacity;
- The message was rejected and the re-queue was not set
-
How does RabbitMQ implement a delay queue?
- Based on database + timing tasks;
- Message expired + dead letter queue;
- Delay queue plugin.
-
What conditions can cause the message to be lost? How to solve it? Which conditions can cause message duplication? How to solve it?
Analyze the entire process of message sending. -
Can the x-max-length maximum number of messages in the queue be used to limit the flow? For example, the spike scenario.
No, because the first entry message will be deleted, which is unfair. -
How to increase the rate of message consumption?
Create multiple consumers. -
What is the difference between AmqpTemplate and RabbitTemplate?
Spring AMQP is an abstraction of Spring integrating AMQP. Spring-Rabbit is an implementation. -
How to dynamically create a consumer listener queue?
Via ListenerContainer
container.setQueues(getSecondQueue(), getThirdQueue()); //监听的队列
-
How to encapsulate messages in Spring AMQP? What conversion is used?
Message, MessageConvertor -
How to ensure the order of messages?
A queue has only one consumer -
RabbitMQ cluster node type?
Disk node and memory node -
How to ensure the high availability of RabbitMQ?
HAProxy(LVS)+Keepalived -
What if a large amount of news accumulates?
Create more consumers to consume at the same time -
MQ selection analysis
the use and management
API, and Spring integrated management console, authority, security, scalability, monitoring
community support
performance concurrency
message throughput messaging capability accumulation
function
transactional message
sequence messages
Message Retry
Dead Letter Queue
priority queue
Delay queue
Reliable + available cluster
Persistent message synchronization -
What is your idea when designing an MQ?
Store and forward.
Storage: Memory: What data structure?
Disk: File system? Database?
Communication: Communication protocol (TCP HTTP AMQP)? One-to-one? One-to-many? Push mode? Pull mode?