Skip to content Skip to sidebar Skip to footer

Error: Illegal Wire Type For Field Message.field .protobuf.messagetypeack.sourcemoduleid: 1 (0 Expected)

I've app that procude&consume message with kafka and protocol buffer and everything works great. I'm serialize the protocol buffer with SerializeAsString() (this app was writte

Solution 1:

so, Thanks to this SO question&answer, I figured it out! The problem is related to the way I've consume the buffer (by kafka) - as utf-8 (default). It actually related to code which I didn't attached:

var kafka = require('kafka-node'),
    Consumer = kafka.Consumer,
    client = new kafka.Client('localhost:2181'),
    consumer = newConsumer(
        client,
        [
            { topic: 'Genesis', partition: 0 }
        ],
        {
            autoCommit: false,
            encoding: 'buffer'
        }
    ); 

and the solution was to add the encoding: 'buffer' line (the default is 'utf-8' as mentioned here).

Post a Comment for "Error: Illegal Wire Type For Field Message.field .protobuf.messagetypeack.sourcemoduleid: 1 (0 Expected)"