ERR_BUFFER_OUT_OF_BOUNDS on liste message reception
Hello,
I'm facing an issue with kafkajs when I receive a list of message.
Actually, I have a consumer waiting for messages from different topics. I use the eachMessage method to manage the received messages.
When the topic send message one by one, all is fine, the message is read correctly. But when I receive a list of messages (some send a full stack datas), My app crash with the error ERR_BUFFER_OUT_OF_BOUNDS
Here is the full error message :
{"level":"ERROR","timestamp":"2022-08-05T16:02:12.925Z","logger":"kafkajs","message":"[Consumer] Crash: RangeError: Attempt to access memory outside buffer bounds","groupId":"customGroupId","stack":"RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds\n at new NodeError (internal/errors.js:322:7)\n at boundsError (internal/buffer.js:83:11)\n at Buffer.readInt8 (internal/buffer.js:423:5)\n at Decoder.readInt8 (/app/node_modules/kafkajs/src/protocol/decoder.js:32:31)\n at module.exports (/app/node_modules/kafkajs/src/protocol/recordBatch/record/v0/decoder.js:28:30)\n at decodeRecord (/app/node_modules/kafkajs/src/protocol/recordBatch/v0/decoder.js:117:10)\n at /app/node_modules/kafkajs/src/protocol/recordBatch/v0/decoder.js:94:48\n at Decoder.readArray (/app/node_modules/kafkajs/src/protocol/decoder.js:182:18)\n at decodeRecords (/app/node_modules/kafkajs/src/protocol/recordBatch/v0/decoder.js:94:27)\n at module.exports (/app/node_modules/kafkajs/src/protocol/recordBatch/v0/decoder.js:84:25)"}
I cannot find any solution to resolve this issue. Can you help me with it ?
Best regards