Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 513 Bytes

README.md

File metadata and controls

10 lines (7 loc) · 513 Bytes

Transactional producer example

This example shows you how to use the Sarama transactional producer. The example simply starts some goroutine that produce endlesslly on associated topic.

$ go run main.go -brokers="127.0.0.1:9092" -topic "sarama" -producers 10 -records-number 10000

To ensure transactional-id uniqueness it implement some ProducerProvider that build a producer appending an integer that grow when producer is created. You can also see record-rate each 5s printing on stdout.