Skip to content

Instantly share code, notes, and snippets.

@yankov

yankov/gist:5843404

Created Jun 23, 2013
Embed
What would you like to do?
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