当前位置:网站首页>Getting started with message queuing MQ

Getting started with message queuing MQ

2022-06-11 22:30:00 InfoQ



The soul of the message queue :

1. What is the message queue ?

2. Can do ?

3. Advantages and disadvantages ?

4. Why message queues ?

activemq Of ,kafka,rabbitmq、

For getting started :

https://blog.csdn.net/m0_37499059/article/details/79958073
\

1. Why message queues :

The way the interviewer expects to answer :

  The company's business scenario

  Technical challenges encountered ,

  If not mq What trouble will there be ,

  But with mq What are the benefits ;

1.1  Message queue scenario :

You can find it in the blog :  decoupling 、 asynchronous 、 Peak shaving ;

no need mq System coupling scenario



The use of MQ The system serves as   Benefits of scenarios :



After multi system interaction ==> The cost of changing the code is high

Use MQ Can reduce coupling ;

Interview skills :   Consider whether there is in your scenario ,  A module corresponds to the use of other systems or modules ;

2. introduce MQ The problems that arise ;

2.1 Reduced system availability :
Because there are many external access systems



But when MQ After downtime or , Unable to send a message , Traffic can cause data processing problems , There will be great problems in the availability of various systems ;

MQ Hang up , Will cause many systems to crash ;
2.2   System complexity becomes higher
MQ What might happen :

  • Data message lost \
  • Ensure that messages are not consumed repeatedly
  • How to ensure the transmission order of data messages

2.3 Data consistency issues
A data request is sent to the system A,  after MQ Sending of ,  The original request is the system ABCD  It's all done  , To return results , System ABCD Execution succeeded , however D The system failed to execute , This causes the entire request to return success to the user , The result is that the logic of success in the background is actually a little poor , Not fully implemented

( in other words MQ The previous return succeeded , But in BCD In the later system, there will be an incomplete implementation , Result in data inconsistency )

  • each MQ Advantages and disadvantages ;

activeMQ,RabbitMQ



原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206112202477423.html