slaventius 2 years ago
parent 0731ca07d1
commit a559ad0160
  1. 5
      cmd/main.go

@ -10,14 +10,13 @@ import (
func main() { func main() {
ctx := context.Background() ctx := context.Background()
config := kafka.ReaderConfig{ consumer := kafka.NewReader(kafka.ReaderConfig{
Brokers: []string{"localhost:9092"}, Brokers: []string{"localhost:9092"},
Topic: "topic-A", Topic: "topic-A",
Partition: 0, Partition: 0,
MinBytes: 10e3, // 10KB MinBytes: 10e3, // 10KB
MaxBytes: 10e6, // 10MB MaxBytes: 10e6, // 10MB
} })
consumer := kafka.NewReader(config)
defer consumer.Close() defer consumer.Close()
// //

Loading…
Cancel
Save