Add Kafka producer configs enable_idempotence and max_in_flight_requests_per_connection to help ensure that exactly one copy of each message is written in the stream in face of producer retries
What does this PR do?
With producer idempotence, it ensures that duplicates are not introduced due to unexpected retries due to some intermittent issue e.g. network problem, etc.
This PR exposes the Kafka producer configurations: enable_idempotence and max_in_flight_requests_per_connection which is optional to Logstash users.
How to enable idempotence for Kafka producer
Enabling idempotence requires max.in.flight.requests.per.connection to be less than or equal to 5 (with message ordering preserved for any allowable value), retries to be greater than 0, and acks must be 'all'.
Release notes
Add Kafka producer configs
enable_idempotence
andmax_in_flight_requests_per_connection
to help ensure that exactly one copy of each message is written in the stream in face of producer retriesWhat does this PR do?
With producer idempotence, it ensures that duplicates are not introduced due to unexpected retries due to some intermittent issue e.g. network problem, etc.
This PR exposes the Kafka producer configurations:
enable_idempotence
andmax_in_flight_requests_per_connection
which is optional to Logstash users.How to enable idempotence for Kafka producer
Enabling idempotence requires max.in.flight.requests.per.connection to be less than or equal to 5 (with message ordering preserved for any allowable value), retries to be greater than 0, and acks must be 'all'.
How is this PR test locally
Runs a local Kafka cluster
Launch the test Kafka script
Connect a consumer
Setup Logstash Kafka output & run
Install the plugin in development mode
Run logstash
Verify if Logstash producer config is according to what is configured
Observe Kafka producer config printed on Logstash console
Verify if Logstash is able to producing messages
From the Logstash console, enter some messages via
stdin
. Verify the logstash consumer console if the message is received.Related issues