Skip to content

Allow setting Set ConsumerGroupConfig.Timeout from ReaderConfig #1363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,17 @@ type ReaderConfig struct {
// back to using Logger instead.
ErrorLogger Logger

// Timeout is the network timeout used when communicating with the consumer
// group coordinator. This value should not be too small since errors
// communicating with the broker will generally cause a consumer group
// rebalance, and it's undesirable that a transient network error intoduce
// that overhead. Similarly, it should not be too large or the consumer
// group may be slow to respond to the coordinator failing over to another
// broker.
//
// Default: 5s
Timeout time.Duration

// IsolationLevel controls the visibility of transactional records.
// ReadUncommitted makes all records visible. With ReadCommitted only
// non-transactional and committed records are visible.
Expand Down Expand Up @@ -737,6 +748,7 @@ func NewReader(config ReaderConfig) *Reader {
StartOffset: r.config.StartOffset,
Logger: r.config.Logger,
ErrorLogger: r.config.ErrorLogger,
Timeout: r.config.Timeout,
})
if err != nil {
panic(err)
Expand Down