Log a single error line for KafkaException exceptions when polling

Fixes #31
This commit is contained in:
R. Tyler Croy 2015-08-14 10:13:17 -07:00
parent 623aa6b10a
commit 5df6083e6d
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 4 additions and 4 deletions

View File

@ -10,14 +10,11 @@ import kafka.cluster.Broker
import kafka.client.ClientUtils
import kafka.consumer.SimpleConsumer
import kafka.common.TopicAndPartition
import kafka.common.KafkaException
import kafka.javaapi.*
/* UGH */
import scala.collection.JavaConversions
/* Can't type check this because it makes the calls in and out of Scala an
* atrocious pain in the ass
*/
//@TypeChecked
class KafkaPoller extends Thread {
private final Integer POLLER_DELAY = (1 * 1000)
private final String KAFKA_CLIENT_ID = 'VerspaetungClient'
@ -58,6 +55,9 @@ class KafkaPoller extends Thread {
try {
dumpMetadata()
}
catch (KafkaException kex) {
logger.error("Failed to interact with Kafka: ${kex.message}")
}
catch (Exception ex) {
logger.error("Failed to fetch and dump Kafka metadata", ex)
}