Skip to content

Commit

Permalink
auto split kafkaURL to array (segmentio#280)
Browse files Browse the repository at this point in the history
auto split kafkaURL to array
  • Loading branch information
zgfh authored and Achille committed Jul 22, 2019
1 parent 59f58f0 commit e31ffda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/consumer-logger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import (
"fmt"
"log"
"os"
"strings"

kafka "github.com/segmentio/kafka-go"
)

func getKafkaReader(kafkaURL, topic, groupID string) *kafka.Reader {
brokers := strings.Split(kafkaURL, ",")
return kafka.NewReader(kafka.ReaderConfig{
Brokers: []string{kafkaURL},
Brokers: brokers,
GroupID: groupID,
Topic: topic,
MinBytes: 10e3, // 10KB
Expand Down

0 comments on commit e31ffda

Please sign in to comment.