-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
ZStandard is not documented #910
Comments
The compression codes are not shipped as part of KafkaJS itself, as there's no reason for you to have a dependency on for example snappy if you are not using snappy. That's why we've made the compression codes pluggable, so that you can add whatever compression codec you need and not any others. We had to do some work on our side to support newer versions of the Kafka protocol in order to be able to support zstandard compression, which we have now done. What's missing is a codec. In the case of zstandard, no one has written a compression codec as of yet. The codecs are generally very simple - they're just a piece of glue to adapt the underlying compression library to KafkaJS' expected interface. If you take a look at kafkajs-snappy, it's very simple: https://github.com/tulios/kafkajs-snappy/blob/master/src/index.js The challenging bit is the actual compression. For zstandard, there really isn't a good, maintained set of bindings to the zstandard C-library. The closest I've found is https://github.com/zwb-ict/node-zstd, which hasn't been updated since 2016 and certainly won't build with modern node versions. So when we say that we support zstandard compression, it means that we support all the bits around Kafka to enable zstandard. Writing an actual compression library is quite out of scope for us, but if someone were to update node-zstd or write a new set of bindings, it would just be a matter of plugging it into KafkaJS and everything should work. |
Well answered! Thanks. |
Turns out there was a bug in kafkajs that made this impossible. I have a PR up (#912) to fix it. Once that's merged, zstd is possible. I wrote a codec for it that does work. However, it's depending on what looked like the most promising fork of |
Describe the bug
It's not clear how to configure ZStandard despite it being marked fixed and implemented in PR:s and README:
And https://github.com/tulios/kafkajs/pulls?q=is%3Apr+zstd+is%3Aclosed in particular #875
snappy
haskafkajs-snappy
but there's no kafkajs-zstd https://www.npmjs.com/search?q=kafkajs-zstdany => ()
anywhere, for itThe text was updated successfully, but these errors were encountered: