Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka Improvements #1351

Merged
merged 63 commits into from
Mar 29, 2021
Merged

Kafka Improvements #1351

merged 63 commits into from
Mar 29, 2021

Conversation

iancooper
Copy link
Member

The Kafka client is not fit for prime time right now, it has some glaring problems such as the inability to set a partition key, and problems around how the consumer handles errors. This PR will fix that

@iancooper iancooper linked an issue Feb 25, 2021 that may be closed by this pull request
@iancooper
Copy link
Member Author

The asynchronous nature of the callback, coupled with an Outbox, means I have made some changes to how producers work here:

  • We now set a threshold for failed sends in the Outbox
  • Because we always write to the Outbox, although we retry a send, we don't crash on a failed send
  • Instead we just don't mark it as sent
  • So the new producer properties tell us how many outstanding requests there can be in a time window
  • Exceed that number, and then we throw an OutboxLimitExceeded error.

This also revealed a couple of defects in the existing InMemoryBox code

  • A monitor lock has to be taken and released on the same thread, not different ones
  • This meant that housekeeping processes were only running once
  • This has been fixed, so that the process now always runs when triggered, but the thread will terminate without doing work if it can't get the lock

@iancooper iancooper marked this pull request as ready for review March 26, 2021 21:31
Copy link
Member

@holytshirt holytshirt left a comment

Choose a reason for hiding this comment

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

I need a beer after reading through that. I think it looks okay so going to bring it in after the tests work.

@holytshirt holytshirt merged commit 35e9956 into master Mar 29, 2021
@holytshirt
Copy link
Member

Merge had to a bit of manual merging locally due to the json stuff, but all fixed now

@holytshirt holytshirt deleted the improve_kafka branch March 29, 2021 17:05
@iancooper
Copy link
Member Author

Thanks mate

@iancooper
Copy link
Member Author

The real issue is the failures around the CI for Kafka. It's not clear what is going wrong, but I think is post my adding the tests that run on Confluent

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

Successfully merging this pull request may close these issues.

Kafka on Confluent Cloud
3 participants