Introduction to kafka, data order, data disorder (10)

data order

insert image description here

Data disorder

insert image description here
max.in.flight.requests.per.connection specifies how many messages the producer can send before receiving a response from the server.

Before version 1.x, kafka ensured that single partitions are in order, and the conditions are as follows:
max.in.flight.requests.per.connection=1
2) In versions 1.x and later, kafka ensures that single-interval data partitions are in order, and the conditions are as follows:
Disabled Idempotency
max.in.flight.requests.per.connection needs to be set to 1
to enable idempotency
max.in.flight.requests.per.connection needs to be set to be less than or equal to 5.
Reason: Because after kafka1.x, start idempotence Finally, Kafka will cache the latest 5 request source data sent by the producer, so no matter what, it can guarantee that the last 5 request data are in order

Guess you like

Origin blog.csdn.net/weixin_43205308/article/details/131445983