Skip to content

Instantly share code, notes, and snippets.

@maiha
Created July 6, 2015 16:30
Show Gist options
  • Save maiha/0dfd5e4fccaa5f563a3d to your computer and use it in GitHub Desktop.
Save maiha/0dfd5e4fccaa5f563a3d to your computer and use it in GitHub Desktop.
import seven.kafka.consumer._
val options = KafkaBasicConsumer.defaultOptions ++ Map("auto.commit.enable" -> "true")
def consume(t: String, g: String): Unit = {
val consumer = new KafkaBasicConsumer("localhost:2181", g, options)
consumer.basicConsume(t, DefaultCallback)
Thread.sleep(1000)
consumer.shutdown()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment