In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how Kafka ensures the sequencing of messages. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. problem
Let's say we built a topic with three partition. When writing, the producer can actually specify a key. For example, if we specify an order id as the key, then the data related to the order must be distributed to the same partition, and the data in this partition must be in order.
When consumers take data out of partition, there must be an order. At this point, the order is still ok, not out of order. Next, we may have multiple threads in the consumer to process messages concurrently. Because if consumers consume processing in a single thread, and the processing is time-consuming, for example, it takes dozens of ms to process a message, then only dozens of messages can be processed per second, which is too low in throughput. If multiple threads run at the same time, the order may be out of order.
two。 Solution
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.