Skip to content

Instantly share code, notes, and snippets.

@joan38
Created May 21, 2018 09:15
Show Gist options
  • Select an option

  • Save joan38/7a6cc741f66e95369bb0bcb74efe3ebe to your computer and use it in GitHub Desktop.

Select an option

Save joan38/7a6cc741f66e95369bb0bcb74efe3ebe to your computer and use it in GitHub Desktop.
val config = new Properties()
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka:9092")
val postProducer = Producer[Post](config)
val post = Post(Id[Post]("post0"), Instant.now(), Id[User]("user0"), "Some text", URI.create("https://some-uri"), false)
postProducer.send(post)
postProducer.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment