Skip to content

Commit

Permalink
add params acks (#126)
Browse files Browse the repository at this point in the history
Co-authored-by: Kou Jiawen <jiawen.kou@za.group>
  • Loading branch information
burgess001 and Kou Jiawen authored Sep 20, 2024
1 parent 353d2e8 commit 702387c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ package main

import (
"fmt"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"gopkg.in/yaml.v2"
"os"
"strings"
"text/template"

dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"gopkg.in/yaml.v2"

"github.com/sirupsen/logrus"
)

Expand All @@ -45,6 +46,7 @@ var (
kafkaSaslUsername = ""
kafkaSaslPassword = ""
serializer Serializer
kafkaAcks = "all"
)

func init() {
Expand Down Expand Up @@ -111,6 +113,9 @@ func init() {
if value := os.Getenv("KAFKA_SASL_PASSWORD"); value != "" {
kafkaSaslPassword = value
}
if value := os.Getenv("KAFKA_ACKS"); value != "" {
kafkaAcks = value
}

if value := os.Getenv("MATCH"); value != "" {
matchList, err := parseMatchList(value)
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func main() {
"batch.num.messages": kafkaBatchNumMessages,
"go.batch.producer": true, // Enable batch producer (for increased performance).
"go.delivery.reports": false, // per-message delivery reports to the Events() channel
"acks": kafkaAcks,
}

if kafkaSslClientCertFile != "" && kafkaSslClientKeyFile != "" && kafkaSslCACertFile != "" {
Expand Down

0 comments on commit 702387c

Please sign in to comment.