Add an option to only commit consumer offsets for records that are not filtered out using RecordFilterStrategy
Expected Behavior
When using a RecordFilterStrategy in combination with an AckMode like RECORD, only the consumer offsets of the records that have been handled, should be committed.
Suggestion: Add a new AckMode = RECORD_FILTERED that commits the offset only when a record is not filtered out.
Current Behavior
When using ack-mode: RECORD, the offset of every record is committed to Kafka even if it was filtered out.
Context
The synchronous commit of consumer record offset is an expensive operation. It slows down record consumption unnecessarily in case the consumer is only interested in a small percentage of the records and still wants every record that is processed to be committed.
@geertvb Thanks for the report. This is almost like a new feature that we need to think through. We are so close to an RC for the 3.3.0 release. I think we need to postpone these types of changes at this point in our release cycle to the next minor version (3.4.x).
Hi @sobychacko, thanks for the quick response and considering it as a feature for one of the next releases. For the time being we work around the issue by using a pure kafka-client ConsumerInterceptor.
Hi @sobychacko , just wanted to check if this is ready for pickup now or if its already been done ?
@Sauhardstark We haven't gotten to this yet, but if you want to contribute a PR, that would be appreciated. Thanks!
Hi @sobychacko, I'd like to work on this issue if it's available. Could you please assign this issue to me? Thanks!
(I have already looked into the source code)
Hi @Chaedie, please go ahead and submit a PR.
@Chaedie Any updates on this issue? No problem if you are not ready to send a PR, but we have the RC release happening next week, so if you are in the middle of this PR, this might be the time to submit a PR.
@sobychacko Thanks for the reminder. I already implemented the code. But I've been too shy to open the PR... 😅 I'll open a PR within the next 24 hours.