How does Kafka keep the partitions orderly?
This article introduces the relevant knowledge of "how to ensure the orderly division of Kafka". In the operation of actual 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!
Can Kafka achieve global order?
Kafka can only ensure that the partitions are orderly.
If there is only one partition
That is also the overall order of the change of direction.
How to ensure the order of partitions in Kafka
By configuring max.in.flight.requests.per.connection = 1
This configuration is the number of requests from the producer to send data to the service level.
If configured to 1, only 1 request can be sent at a time
If you fail and try again, you will know the success.
Before the next request is sent.
This ensures the order of the message.
But the relative performance is greatly reduced.
Through the idempotent property of the producer
The guarantee of idempotency is to add a Seqnum to each message.
That is, each message has its own serial number.
The server is responsible for messages greater than 1 than the latest Seqnum
Will refuse.
So it can also ensure the order of the message.
This is the end of the content of "how to keep the partition orderly in Kafka". 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!