Skip to content

Commit

Permalink
chore: update kafka source doc (#1480)
Browse files Browse the repository at this point in the history
Signed-off-by: jyu6 <[email protected]>
  • Loading branch information
jy4096 authored Jan 24, 2024
1 parent 83bd365 commit 36f7002
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/user-guide/sources/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ spec:
- my-broker2:19700
topic: my-topic
consumerGroup: my-consumer-group
config: | # Optional.
consumer:
offsets:
initial: -2 # -2 for sarama.OffsetOldest, -1 for sarama.OffsetNewest. Default to sarama.OffsetNewest.
tls: # Optional.
insecureSkipVerify: # Optional, where to skip TLS verification. Default to false.
caCertSecret: # Optional, a secret reference, which contains the CA Cert.
Expand Down
4 changes: 4 additions & 0 deletions pkg/shared/util/saramaconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package util
import (
"testing"

"github.com/IBM/sarama"
"github.com/stretchr/testify/assert"
)

Expand All @@ -33,6 +34,8 @@ producer:
consumer:
fetch:
min: 1
offsets:
initial: -2
net:
MaxOpenRequests: 5
`)
Expand All @@ -41,6 +44,7 @@ net:
assert.Equal(t, 600, conf.Producer.MaxMessageBytes)
assert.Equal(t, 103, conf.Admin.Retry.Max)
assert.Equal(t, int32(1), conf.Consumer.Fetch.Min)
assert.Equal(t, sarama.OffsetOldest, conf.Consumer.Offsets.Initial)
assert.Equal(t, 5, conf.Net.MaxOpenRequests)
})
t.Run("Empty config", func(t *testing.T) {
Expand Down

0 comments on commit 36f7002

Please sign in to comment.