Don't reconnect if we have invalid data in our brokerConsumerMap, just warn about it

Fixes #30
This commit is contained in:
R. Tyler Croy 2015-08-14 15:11:16 -07:00
parent be33333bfa
commit b6bbcf92a4
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 2 additions and 2 deletions

View File

@ -117,10 +117,10 @@ class KafkaPoller extends Thread {
SimpleConsumer consumer = this.brokerConsumerMap[leaderId]
/* If we don't have a proper SimpleConsumer instance (e.g. null) then
* we should reconnect on our next time around
* we might not have gotten valid data back from Zookeeper
*/
if (!(consumer instanceof SimpleConsumer)) {
this.shouldReconnect = true
logger.warn("Attempted to the leaderId: ${leaderId} (${topic}/${partition}")
return 0
}
TopicAndPartition topicAndPart = new TopicAndPartition(topic, partition)