-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
[bug] L4Z implementation is broken on nodejs18 #1543
Comments
We switched to lz4-kafkajs yesterday (also nodejs 18) |
Seeing this on Node16 as well for some reason. Also on Node 18 too. |
Hello all, I'm having the issue too, here what i've made: on documentation it's written that you can easely create you own codec: const lz4 = require('lz4'); // using https://www.npmjs.com/package/lz4
module.exports = {
/**
* @param {Encoder} encoder
* @returns {Promise}
*/
async compress(encoder) {
return lz4.encode(encoder.buffer);
},
/**
* @param {Buffer} buffer
* @returns {Promise}
*/
async decompress(buffer) {
return lz4.decode(buffer);
},
} and then : const { Kafka, CompressionTypes, CompressionCodecs } = require('kafkajs');
const lz4Codec = require('lz4Codec');
CompressionCodecs[CompressionTypes.LZ4] = () => lz4Codec;
const kafka = new Kafka({
brokers: [broker],
clientId: 'test client',
});
const producer = kafka.producer();
await producer.connect();
await producer.send({
compression: CompressionTypes.LZ4,
topic: topic,
messages: [{value: message}],
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hi, the L4Z implementation suggested in the documentation is broken on nodejs18
To Reproduce
Observed behavior
The error is about the
_lz4.wasm
file:Environment:
Additional context
The issue has already been reported, and there's a hackaround that doesn't work for me, surely because I use
esbuild
.The kafkajs-lz4 implementation seems veeeery old (+2y without a commit, and still in beta), do you have an alternative? Thanks
The text was updated successfully, but these errors were encountered: