Last active
August 22, 2016 22:48
-
-
Save 0sc/e82b0242773e79c2df654a318168a7cb to your computer and use it in GitHub Desktop.
Code snippet for sarama producer described here:
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
//addresses of available kafka brokers | |
brokers := []string{'localhost:9201'} | |
//setup relevant config info | |
config := sarama.NewConfig() | |
config.Producer.Partitioner = sarama.NewRandomPartitioner | |
config.Producer.RequiredAcks = sarama.WaitForAll | |
producer, err := sarama.NewSyncProducer(brokers, config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment