Open
Conversation
Member
Author
|
I have used Kafka very little in my work experience 😅, but I believe the important thing was to start laying the groundwork and try to make this conversion, so if you find any errors or parts that could be improved, please feel free to leave feedback. We could compile a list as a reminder so we can update the code. |
kibertoad
reviewed
Mar 5, 2026
88668ed to
f384b28
Compare
ShogunPanda
reviewed
Mar 10, 2026
ShogunPanda
left a comment
There was a problem hiding this comment.
Thanks for considering @platformatic/kafka. A few nits for you but in general it looks fine!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR migrates
@fastify/kafkafromnode-rdkafkato@platformatic/kafka( see issue: #158 )Motivation
node-rdkafkarelies on native C++ bindings which complicate cross-platform builds and CI pipelines.@platformatic/kafkais a pure JavaScript implementation with a modern async API, better maintained and aligned with the Fastify ecosystem.Changes
lib/producer.js— rewritten using@platformatic/kafkaProducer;push()is now fully asynclib/consumer.js— rewritten using@platformatic/kafkaConsumer; supports both flow mode (event-based streaming) and batch mode (consume(n, cbk)) with configurable timeoutindex.js— plugin structure unchanged; wiring updated to match new producer/consumer APIindex.d.ts— types updated to reference@platformatic/kafkadocker-compose.yml— switched to KRaft mode (no Zookeeper) usingconfluentinc/cp-kafka:7.6.1test/— full rewrite usingnode:test; covers producer, consumer, error handling, batch timeout, stream destructionREADME.md— updated usage examples and added migration guide fromnode-rdkafkaexamples/basic.js— added a working end-to-end example showing producer and consumer setup, topic subscription, flow mode consumption, and graceful shutdownThanks to the @platformatic team for creating
@platformatic/kafka🙏