RabbitMQ learning (eight) "RabbitMQ interview questions"

  1. The role and usage scenarios of message queues
    Key points: keywords + application scenarios

  2. 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.

  3. What are the routing methods for RabbitMQ's messages? What business scenario is it suitable for?
    Direct, Topic, Fanout

  4. What is the binding relationship between switch and queue, queue and consumer?

  5. Where did the unrouted message go?

    • Discard directly.
    • The backup switch (alternate-exchange) receives.
  6. 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
  7. How does RabbitMQ implement a delay queue?

    • Based on database + timing tasks;
    • Message expired + dead letter queue;
    • Delay queue plugin.
  8. 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.

  9. 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.

  10. How to increase the rate of message consumption?
    Create multiple consumers.

  11. What is the difference between AmqpTemplate and RabbitTemplate?
    Spring AMQP is an abstraction of Spring integrating AMQP. Spring-Rabbit is an implementation.

  12. How to dynamically create a consumer listener queue?
    Via ListenerContainer

container.setQueues(getSecondQueue(), getThirdQueue()); //监听的队列
  1. How to encapsulate messages in Spring AMQP? What conversion is used?
    Message, MessageConvertor

  2. How to ensure the order of messages?
    A queue has only one consumer

  3. RabbitMQ cluster node type?
    Disk node and memory node

  4. How to ensure the high availability of RabbitMQ?
    HAProxy(LVS)+Keepalived

  5. What if a large amount of news accumulates?
    Create more consumers to consume at the same time

  6. 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

  7. 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?

Guess you like

Origin blog.csdn.net/nonage_bread/article/details/111501459
Recommended