Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Add deadline on consumer to send non-empty record batch #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ggml1
Copy link
Contributor

@ggml1 ggml1 commented Apr 23, 2021

Description

I have added a deadline for the consumer to flush non-empty batches to the storage service, which defaults to one minute without receiving new records.

This deadline is also configurable through the environment variable KAFKA_CONSUMER_BATCH_DEADLINE.

For the flush logic to be reusable in both select cases, I have split the send logic in a separate function.

Note: I had to run go mod tidy and import some packages again, because some dependencies were broken and I was unable to test or build in my local environment.

Why is this PR needed?

Closes #8.

Checklist

  • Branch is named according to standards (feature/*, fix/*, hotfix/*)
  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@ggml1 ggml1 requested a review from mateusmoury as a code owner April 23, 2021 18:31
@ggml1 ggml1 requested a review from racevedoo April 23, 2021 18:33
src/kafka/consumer.go Outdated Show resolved Hide resolved
@ggml1 ggml1 force-pushed the batch-production-deadline branch from 7a872fd to d5d3617 Compare April 23, 2021 20:39
@ggml1 ggml1 requested a review from racevedoo April 23, 2021 20:39
Copy link

@rodz rodz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o cara eh bom, fica aqui meu approved
pikachu_dancing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronous flush
3 participants