Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, andacks
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