Skip to content

Instantly share code, notes, and snippets.

@yankov
Created June 23, 2013 01:48
Show Gist options
  • Save yankov/5843404 to your computer and use it in GitHub Desktop.
Save yankov/5843404 to your computer and use it in GitHub Desktop.
producer example
val topic = "urls"
val props = new Properties()
props.put("broker.list", "0:localhost:9092")
props.put("serializer.class", "kafka.serializer.StringEncoder")
val config = new ProducerConfig(props)
val producer = new Producer[String, String](config)
val data = new ProducerData[String, String](topic, href)
producer.send(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment