In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use MQ message queue". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Message production failed
Generally speaking, the middleware from the producer to MQ is called through the network, so it is possible to fail if it is called through the network. The following reasons may cause MQ production failures, such as network fluctuations. Although private network calls are made between producers and MQ servers, it does not mean that the success rate of network calls is 100%. Private network calls will also encounter network fluctuations, resulting in call timeouts or failures. If the Crash of the calling MQ machine is dropped instantly, it is also possible to cause the call to fail. In the face of the failure of the producer to call MQ, it is easy for us to deal with it. We can simply retry. If we fail 2-3 times, it is very likely that there will be a major problem. It is not meaningful to try again at this time. We need to give an alarm and let the development, operation and maintenance intervene and deal with it.
MQ failed to process storage
After the message arrives in the message middleware, it is usually stored. Only when it is written to disk, the message is really stored and will not be lost. However, most MQ middleware does not write to the disk immediately after receiving the message, just because the write speed of the disk is much slower than memory, so a messaging system like Kafka will write the message to the buffer and write it to disk asynchronously. If the machine is suddenly powered off midway, it is possible to lose the message. To solve this problem, most MQ are deployed in a distributed way. Messages are successfully written to the cache on multiple machines before they are successfully returned to the business side. Since the possibility of multiple machines being powered off at the same time is low, we can consider this a relatively low-cost and reliable solution.
Consumer processing failed
A general MQ has a MQ retry mechanism, and if the processing fails, it will try to consume the MQ repeatedly. The problem with this is that MQ may have been successfully consumed, but failed to notify the MQ middleware, resulting in message repeat consumption. Similarly, when producers try again, they will also encounter the problem of repeated consumption of messages. At this time, we are required to design the interface as idempotent as possible. At this time, even if we repeat consumption, we don't have to worry about anything. Basically, by doing these three points well, we can greatly improve the usability of our system!
That's all for the content of "how to use MQ message queue". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.