Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

20 linhas
374 B

  1. package kafkaclient
  2. import (
  3. "time"
  4. "github.com/segmentio/kafka-go"
  5. )
  6. func KafkaWriter(kafkaURL, topic string) *kafka.Writer {
  7. return &kafka.Writer{
  8. Addr: kafka.TCP(kafkaURL),
  9. Topic: topic,
  10. Balancer: &kafka.LeastBytes{},
  11. Async: false,
  12. RequiredAcks: kafka.RequireAll,
  13. BatchSize: 100,
  14. BatchTimeout: 10 * time.Millisecond,
  15. }
  16. }