tomekowal
We’d like to start using RedPanda at work and I am hunting for a Kafka client library.
There are three options I’ve seen so far:
- kafka_ex. It looks like it is in a transition period between 0.x to 1.x. There is
KafkaEx.New.KafkaExAPI. - brod. Made by Klarna, looks stable
- kaffee. A wrapper around brod that in the README claims to be experimental.
I don’t mind using experimental or unstable code. I could potentially contribute but is there someone who used at least two of them and can compare? Do they differ in architecture? Is one of them easier to use? Do they make different trade-offs?
While searching the forum, I saw @keathley shared a lot about Kafka usage. Thanks for the slides from your presentation about it! Is it available somewhere as a video? I hope you don’t mind the ping ![]()
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
keathley
I prefer to use Brod, but Brod is kinda weird. I ended up writing my own wrapper at B/R that never got open sourced. You want to avoid a lot of the wrappers that use GenStage because they don’t handle partitions correctly and will allow messages to be processed out of order. Obviously, this only matters if you rely on kafka’s partition ordering (we did). But overall Brod will do what you need and have the fewest surprises. Build your own wrapper once you know what features or improvements you need for your use case.
dimitarvp
Sorry for necro but IMO this is relevant still.
I am open to try
spreedly/kaffeand will report what I have ended up with.:brodseems to be stable and mature but is not easy to navigate and while I recognize that’s not a strictly good argument between techies, I also don’t want to hunt for mysterious errors or, much worse, silent failure modes.anuaralfetahe
I’ve been using kafka_ex and it works well for my use case.
It feels simple enough and I can build my domain logic around it as needed.
I think the other options you mentioned are solid libraries too.
dimitarvp
Ah,
kafka_exis indeed another contender. I’ll take a quick look there as well. Though my potential problem with it is that it’s still in transition to v1.0 and you have to useKafkaEx.Newwhich I am not sure I like – but it is 99% likely to be a minor issue.I really need only consuming and I want the minimum amount of boilerplate. That’s going to be my main criteria.
anuaralfetahe
I found kafka_ex to be a bit more ‘low level’ compared to other libraries. This meant that I had to write more code, particularly the boilerplate code for the processes. However, it provided me with more control over what is happening, which I needed.
It’s definitely worth checking out if you encounter issues with other libraries.
dimitarvp
Hmmmm, thinking of it further, my most pressing issue is in fact being able to mock Kafka… Sigh, I can’t find a library that does this well. I found two that hook to
kafka_exbut… Nevermind, indeed let me fight with this for a bit and see where I arrive at.lud
I don’t have the code anymore so I’ll only from my bad memory but I have used spreedly/kaffe for a year and it was a solid basis to setup the project.
For consuming, if you need to customize the listeners architecture you will need to understand
brod. And you will need to understand brod and kpro etc. to debug some unpleasant errors.Before leaving the project I was seriously considering replacing that whole stack with erlkaf and made a quite convincing replacement PoC in a few hours. There is not much boilerplate either but I had problems with dependencies, hopefully fixed by now.
dimitarvp
I’ve set it up in a new project fairly quickly as well and so far my tests have been convincing (though let’s see how will it act in production…).
Do you remember how did you work around that?
I will avoid any C dependencies if I can help it.
lud
We did not
It was not a frequent error. Just that brod is slow to start and to setup the consumer group. Or we did something wrong but erlkaf booted way faster.
For the mocking part I put a private API in front of the kafka libraries to abstract the consuming/producing API and then I implemented and maintained a simple pubsub system mimicking the behaviours of Kafka. And some test helpers on top of that.
This mock was only for tests but it had it’s own unit tests just to be sure. You need to implement a lot of things. Even if you want to only consume, you will need to produce to your mock from the test.
Anyway, a lot of work, not recommended…
dimitarvp
Yep, that’s why I would prefer a library that comes with a Kafka mock out of the box but oh well. In my current employer colleagues maintain a thin wrapper on top of
:brodbut it only supports producing and I have no free time to contribute to add consuming to it – not yet I don’t have the time anyway, Soon™ I should have it.Ah well, I guess I can just ignore it then, though I am not keen on the idea of losing data which shouldn’t happen anyway because the Kafka topic will be filled by other apps, and the consumer group I’ll use will remember the offset so technically nothing should be lost.