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