Welcome to the Platformatic Kafka development guide! This document will help you set up your development environment and contribute to the project.
Platformatic is an open-source, modern, high-performance, pure TypeScript/JavaScript type safe client for Apache Kafka.
- Node.js: Version 20.19.4, 22.18.0 or 24.6.0 or higher
- pnpm: Package manager (follow the pnpm installation guide)
- Docker (optional): Only required for running tests locally.
git clone https://github.com/platformatic/kafka.git
cd kafkapnpm installThis step is only required if you plan to run tests locally.
docker compose up -d# Development workflow
pnpm test # Run all tests
pnpm run build # Build the package
pnpm run lint # Lint the packageTests require Docker for Kafka cluster setup.
docker compose up -d
You can eventually provide a KAFKA_VERSION environment variable to select a specific version of Kafka.
Note that the images use Confluent Kafka so you need to add 4 to your desider version. For instance, to run on Kafka 3.9.0:
bash
KAFKA_VERSION=7.9.0 docker compose up -d
Then you run the test normally:
pnpm testMemory tests (test/memory/*.memory-test.ts) are not part of the regular test suite or CI.
They use --expose-gc and a 3-broker cluster with sustained backpressure to detect heap
leaks in the consumer stream. Run them manually when modifying the consumer stream, fetch
loop, or backpressure handling:
pnpm run test:memory- Ensure all tests pass:
pnpm test - Run linting:
pnpm run lint - Build all packages:
pnpm run build
- If your PR fixes a GitHub issue, add this at the top of the PR description:
Fixes #<issue-number>.
- Ensure all checks pass and get approval
- Merge using "squash and merge" option
All contributions must include a Developer Certificate of Origin (DCO) sign-off. Use the -s flag when committing:
git commit -s -m "Your commit message"This automatically adds your Signed-off-by line to the commit message. If working with AI assistance, ensure both contributors are signed off.
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
If you want to know how to retroactively add the DCO to your commits, check out this guide.
- Check the documentation
- Join our Discord community for real-time help and discussions
- Open an issue on GitHub
Thank you for contributing to Platformatic Kafka! 🚀