Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

getOffsetsBefore(...) => kafka.common.UnknownException

$
0
0
Hi,

I’m trying to make a request for offset information from my broker, and I get a kafka.common.UnknownException as the result.

I’m trying to use the Simple Consumer API

val topicAndPartition = new TopicAndPartition(“topic3”, 0)
val requestInfo = new java.util.HashMap[TopicAndPartition, PartitionOffsetRequestInfo]()
requestInfo.put(topicAndPartition, new PartitionOffsetRequestInfo(kafka.api.OffsetRequest.EarliestTime, 1))

val request = new kafka.javaapi.OffsetRequest(requestInfo, kafka.api.OffsetRequest.CurrentVersion, clientName)

import kafka.javaapi._
// conn: kafka.javaapi.consumer.SimpleConsumer
val response: OffsetResponse = conn.getOffsetsBefore(request)

println("got response [" + response + “]")

Output:
got response [OffsetResponse(0,Map([test3,1] -> error: kafka.common.UnknownException offsets: 0))]

I really can’t figure out why I’m getting this response. As far as I know, “topic3” with partition “0” exists on the broker, and I can use bin/kafka-console-consumer.sh to consume from it without any problems.

Is there any idea of what could cause this exception?

As it is right now, I’m not even sure if the request gets to the broker. Is there any way of activating more verbose logs on the broker?

I think I’m using a trunk build (2.10-0.8.3-SNAPSHOT)

BR
/Magnus

Viewing all articles
Browse latest Browse all 5648

Trending Articles