kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manikumar (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (KAFKA-3113) Kafka simple consumer inconsistent result
Date Thu, 07 Sep 2017 20:14:02 GMT

     [ 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)

Mime
View raw message