Parameter guaranteeOrdering=true reduces producer throughput
Opened this issue · 4 comments
When the KafkaProducer's parameter guaranteeOrdering is true
the operator automatically sets max.in.flight.requests.per.connection
to 1 when retries are enabled (retries
> 0).
Allowing only one in-flight PRODUCE request, reduces throughput to the broker.
The better choice would be enable.idempotence=true
, which allows max.in.flight.requests.per.connection <= 5
for maximum throughput.
https://medium.com/@stephane.maarek/new-features-of-kafka-2-1-33fb5396b546
As a dependency, acks
must be set to all
, when enable.idempotence
is set true
. Otherwise a ConfigException will be thrown.
When using Kafka 0.10.2 (still supported):
org.apache.kafka.common.errors.UnsupportedVersionException: Attempting to use idempotence with a broker which does not support the required message format (v2). The broker must be version 0.11 or later.
Using the idempotent producer requires dropping the support of Kafka 0.10.2 when the guaranteeOrdering parameter is used with true
.
resolved in Release 3.0.0.