2 things:
- you're only attempting to read from a single TopicAndPartition. Since
your topic has multiple partitions, this probably isn't what you want
- you're getting an offset out of range exception because the offset you're
asking for doesn't exist in kafka.
Use the other
I am using below directsream to consume messages from kafka . Topic has 8
partitions.
val topicAndPart = OffsetRange.create("request5",0,
1,10).topicAndPartition()
val fromOffsets = Map[kafka.common.TopicAndPartition,Long](topicAndPart->0)
val messageHandler = (mmd :