You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Manikumar (JIRA)" <ji...@apache.org> on 2017/09/07 20:14:02 UTC

[jira] [Resolved] (KAFKA-3113) Kafka simple consumer inconsistent result

     [ https://issues.apache.org/jira/browse/KAFKA-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Manikumar resolved KAFKA-3113.
------------------------------
    Resolution: Cannot Reproduce

may be seed broker is different for different topics. simpleconsumer should point to leader broker of the topic. Please reopen if the issue still exists. 


> Kafka simple consumer inconsistent result
> -----------------------------------------
>
>                 Key: KAFKA-3113
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3113
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Goutam Chowdhury
>
> I am trying to read kafka messages using spart api in batch mode.To achieve  
> this , I need start and last offset of the mentioned topic. To get start and last offset I am creating simple consumer with below code
> -----------------------------------------------------------------------------------------
> var consumer = new SimpleConsumer(seedBroker, seedBrokerPort, 100000, 64 * 1024, clientName);
> var topicAndPartition = new TopicAndPartition(topic, partition.toInt)
> var requestInfo = new HashMap[TopicAndPartition,PartitionOffsetRequestInfo];
>  requestInfo.put(topicAndPartition, new PartitionOffsetRequestInfo(whichTime, 1))
>  logger.info("requestInfo - " + requestInfo);
> var request = new kafka.javaapi.OffsetRequest(requestInfo, OffsetRequest.CurrentVersion, clientName);
> var response =consumer.getOffsetsBefore(request);
> -------------------------------------------------------------------
> I am using BIG IP addresses for seed broker  which actually has four brokers . Now if I do spark submit then some times it get exception with below response 
> response - OffsetResponse(0,Map([ecp.demo.patents.control,0] -> error: kafka.common.UnknownTopicOrPartitionException offsets: ))
> but some time i get proper response..... could anybody explain why it is like that? 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)