
org.bdd.reporting.kafka.ManagedKafkaConsumer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bdd-reporting-service Show documentation
Show all versions of bdd-reporting-service Show documentation
BDD Enterprise Reporting Server. This server provides the ability to upload reports from tools like Cucumber,
SpecFlow, Pickles and the information is then aggregated into a central view across all projects.
The newest version!
package org.bdd.reporting.kafka
//import org.apache.commons.logging.Log
//import org.apache.commons.logging.LogFactory
//import org.apache.kafka.clients.consumer.ConsumerRecord
//import org.apache.kafka.clients.consumer.KafkaConsumer
//import java.util.concurrent.Executors
//
///**
// * Created by Grant Little [email protected]
// */
//open class ManagedKafkaConsumer(var map: Map,
// val topics : Set) {
//
// companion object {
// private val LOG : Log = LogFactory.getLog(ManagedKafkaConsumer::class.java)
// }
//
// private var running = true
// private val taskExecutor = Executors.newSingleThreadExecutor()
//
// fun start(handler : (ConsumerRecord) -> Unit) {
// LOG.info("Starting kafka consumer")
// taskExecutor.execute {
// LOG.trace("Kafka consumer")
// val consumer = KafkaConsumer(map)
// consumer.subscribe(topics)
// while (running) {
// try {
// LOG.trace("Polling")
// val result = consumer.poll(5000)
// LOG.info("Returned result $result")
// result?.forEach { handler(it) }
// } catch (e : Exception) {
// LOG.error("Exception caught while polling for message", e)
// }
// }
// consumer.close()
//
// }
// }
//
//
// open fun stop() {
// running = false
// }
//
//
//}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy