You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ ConsumerGroup }=require('kafka-node');varoptions={kafkaHost: 'kafka:9092',groupId: 'TestGroup',};varconsumerGroup=newConsumerGroup(options,'mytopic');consumerGroup.on('message',(message)=>{// XXX: observe that message.value is not a Buffer// there is no option to make it one via ConsumerGroup.// binary data is corrupted from the UTF8 conversionconsole.log(typeofmessage.value);console.log(message.value);});
Output is that message.value is a string. If you use binary encoded data like with AVRO, then you will end up with corrupted data.
Consumer offers an encoding option, but ConsumerGroup does not. It looks like ConsumerGroup needs to include this option and allow it to be passed down.
The text was updated successfully, but these errors were encountered:
mishan
added a commit
to mishan/kafka-node
that referenced
this issue
Dec 4, 2018
It looks like it exists, and a followup comment on another ticket says it's poorly documented, but I'm not familiar with this codebase. See #470 (comment)
I agree with including it in the README. Changing the code makes easier to read in my opinion, but doesn't seem absolutely necessary for calling code to work properly
Aside: It's also already mentioned in ConsumerGroupOptions of types/index.d.ts, so types/index.d.ts doesn't need to be updated.
Environment
For specific cases also provide
Include Sample Code to reproduce behavior
Output is that message.value is a string. If you use binary encoded data like with AVRO, then you will end up with corrupted data.
Consumer offers an encoding option, but ConsumerGroup does not. It looks like ConsumerGroup needs to include this option and allow it to be passed down.
The text was updated successfully, but these errors were encountered: