In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail for you how to understand the basic component architecture design ideas of RabbitMQ in front-line factories. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
1. MQ component implementation function point
MQ component implementation function point 1) supports high-performance serialization conversion, asynchronization to send messages 2) supports connection pooling caching between message production instances and consumption instances, improves performance 3) supports reliable delivery of messages, ensures that messages are not lost at 100%, 4) supports idempotent operations on the consumer side, avoids the problem of repeated consumption on the consumer side, 5) supports rapid message sending mode In some scenarios, 100% successful delivery does not need to be guaranteed, and high performance and ultra-high throughput can be guaranteed under some log collection, statistical analysis and other requirements. 6) support delayed message mode, message sending can be delayed and delay time can be specified. Used for some delay checking, service flow restriction scenarios 7) support transaction messages, and 100% guarantee reliable delivery In the financial industry, there will be such requirements for a single large amount of operations. 8) support sequential messages to ensure the order before and after messages are sent to consumers, such as placing orders and other compound operations. 9) support message compensation and retry. 2. Rapid message sending means that the message is not stored or guaranteed. It is appropriate in some scenarios such as non-core messages, log data, or statistical analysis. The advantage of fast message is the highest performance, maximum throughput 3, batch message sending batch message means that we put the message into a collection to submit and merge the message. For channel, it is to send a message. This method also hopes that the consumer can consume in batch when consuming, but it does not guarantee reliability. The compensation mechanism RabbitMQ does not support batch message sending. 4. Delay message sending delay message is relatively simple, that is, we can add delayTime attribute when Message is encapsulated, so that our message can be sent late, which can be well used according to the specific business scenario. Scenario example: 1) for example, after the goods bought by the e-commerce platform are signed, if you do not click to confirm the payment, then the system will automatically pay within 7 days. 2) there are also some scenarios in which the automatic timeout is invalidated. For example, coupons / red packets have a time limit, you can also use delayed message mechanism 5. Sequential message sending should guarantee the following points: 1) send sequential messages. The message must be delivered to the same queue, and this consumer can only have one (exclusive mode) 2) then it needs to be submitted uniformly (either merged into one large message or split into multiple small messages), and the session ID of all messages is consistent. 3) add the attributes of the message: the sequence number of the sequence tag, the SIZE attribute of this sequential message, and do not consume the message first. After receiving the delay message, the consumer carries on the delay message sent to itself in parallel. Pay attention to the key attributes (session ID, SIZE) for subsequent processing consumption to ensure that all the messages in the delayed event segment have been received. 5) when the delay message is received, the database data can be extracted for processing according to the session ID and SIZE. 6) regular polling compensation mechanism for abnormal cases For example, if the message on the production side is not delivered successfully, or if the consumer terminal library is abnormal, resulting in the lack of message entries after the consumer terminal repository
6. we use a similar reliable delivery mechanism, that is, compensation mechanism, to send transaction messages. The data source we use must be the same, that is, the business operation DB1 database and the message logging DB2 database use the same data source and then rewrite the Spring DataSourceTransactionManager to send the message when the local transaction commits, but it is also possible that the transaction commits successfully but the message fails. At this time, compensation needs to be carried out. 7. The idempotency of the message may lead to non-idempotent reasons: 1) reliable message delivery mechanism 2) network jitter in the process of transmitting messages between MQ Broker services and consumers 3) consumer side failures or anomalies about how to understand the basic component architecture design ideas of RabbitMQ in front-line manufacturers, so much for sharing here. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
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.