You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Eric Rini <er...@gmail.com> on 2014/01/29 05:50:03 UTC

Trying to understand error "Wrong request type 9".

So I am using this https://github.com/SOHU-Co/kafka-node client library
(possibly the only v0.8 node.js library that supports a high level consumer
and has some basic docs). When it connects to the broker, an error like
this appears in the console.

[2014-01-28 23:42:30,423] ERROR Closing socket for /192.168.1.102 because
of error (kafka.network.Processor)

kafka.common.KafkaException: Wrong request type 9

at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:53)

at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:49)

at kafka.network.Processor.read(SocketServer.scala:353)

at kafka.network.Processor.run(SocketServer.scala:245)

at java.lang.Thread.run(Thread.java:722)


Can someone shed some light on what this means? Here's the node.js code...
pretty boilerplate.


var kafka = require('kafka-node');

var kafkaClient = new kafka.Client('localhost:2181', 'test-consumer');

var topics = [

    { topic: 'test3', partition: 0 }

];

var kafkaConsumer = new kafka.Consumer(kafkaClient, topics, {

    autoCommit: false

});

kafkaConsumer.on('message', function (message) {

    console.log('MESSAGE');

    console.log(message);

});

kafkaConsumer.on('error', function (err) {

    console.log('ERROR');

    console.error(err);

});

kafkaConsumer.on('offsetOutOfRange', function (err) {

    console.log(err);

});

Re: Trying to understand error "Wrong request type 9".

Posted by Neha Narkhede <ne...@gmail.com>.
It seems like the client is sending the new OffsetFetchRequest introduced
in 0.8.1. The key for the OffsetFetchRequest is 9. You might want to
upgrade your kafka broker to the latest trunk and see if that works.

Thanks,
Neha


On Tue, Jan 28, 2014 at 8:50 PM, Eric Rini <er...@gmail.com> wrote:

> So I am using this https://github.com/SOHU-Co/kafka-node client library
> (possibly the only v0.8 node.js library that supports a high level consumer
> and has some basic docs). When it connects to the broker, an error like
> this appears in the console.
>
> [2014-01-28 23:42:30,423] ERROR Closing socket for /192.168.1.102 because
> of error (kafka.network.Processor)
>
> kafka.common.KafkaException: Wrong request type 9
>
> at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:53)
>
> at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:49)
>
> at kafka.network.Processor.read(SocketServer.scala:353)
>
> at kafka.network.Processor.run(SocketServer.scala:245)
>
> at java.lang.Thread.run(Thread.java:722)
>
>
> Can someone shed some light on what this means? Here's the node.js code...
> pretty boilerplate.
>
>
> var kafka = require('kafka-node');
>
> var kafkaClient = new kafka.Client('localhost:2181', 'test-consumer');
>
> var topics = [
>
>     { topic: 'test3', partition: 0 }
>
> ];
>
> var kafkaConsumer = new kafka.Consumer(kafkaClient, topics, {
>
>     autoCommit: false
>
> });
>
> kafkaConsumer.on('message', function (message) {
>
>     console.log('MESSAGE');
>
>     console.log(message);
>
> });
>
> kafkaConsumer.on('error', function (err) {
>
>     console.log('ERROR');
>
>     console.error(err);
>
> });
>
> kafkaConsumer.on('offsetOutOfRange', function (err) {
>
>     console.log(err);
>
> });
>