[ 
https://issues.apache.org/jira/browse/STORM-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312301#comment-15312301
 ] 

ASF GitHub Bot commented on STORM-822:
--------------------------------------

Github user jianbzhou commented on the issue:

    https://github.com/apache/storm/pull/1131
  
    @hmcl, today we found one NullpointerException and i applied a fix as below:
    
    In method doSeekRetriableTopicPartitions, if one partition was never 
committed before one message is failed back, we will encounter below issue. 
Could you please help review and let me know if this fix is oaky?
    
    **Code change is as below -from**
    
    //  kafkaConsumer.seekToEnd(rtp);    // Seek to last committed offset
    OffsetAndMetadata commitOffset = kafkaConsumer.committed(rtp);
    kafkaConsumer.seek(rtp, **commitOffset.offset()**);  // Seek to last 
committed offset
    
    **to**
    //  kafkaConsumer.seekToEnd(rtp);    // Seek to last committed offset
    OffsetAndMetadata commitOffset = kafkaConsumer.committed(rtp);
    if(commitOffset != null){
        kafkaConsumer.seek(rtp, commitOffset.offset());  // Seek to last 
committed offset
    } else{
        LOG.info("In doSeekRetriableTopicPartitions, topic partition is {}, no 
offset was committed for this partition, will seek back to the initial offset 
{}", rtp, offsetEntry.initialFetchOffset);
        kafkaConsumer.seek(rtp, offsetEntry.initialFetchOffset); //no offset 
committed for this partition, seek to the original fetch offset
    }



> Kafka Spout New Consumer API
> ----------------------------
>
>                 Key: STORM-822
>                 URL: https://issues.apache.org/jira/browse/STORM-822
>             Project: Apache Storm
>          Issue Type: Story
>          Components: storm-kafka
>            Reporter: Thomas Becker
>            Assignee: Hugo Louro
>             Fix For: 1.0.0, 2.0.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to