Created
August 22, 2016 22:38
-
-
Save 0sc/cd47d90afecaba737c2e9db0d3bab228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
topic := "kafka-topic-for-the-message" //e.g create-user-topic | |
partition := -1 //Partition to produce to | |
msg := "actual information to save on kafka" //e.g {"name":"John Doe", "email":"john.doe@email.com"} | |
message := &sarama.ProducerMessage{ | |
Topic: topic, | |
Partition: partition, | |
Value: sarama.StringEncoder(msg), | |
} | |
partition, offset, err := producer.SendMessage(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment