Skip to content
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
9 changes: 6 additions & 3 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,6 @@ type ReaderConfig struct {
// non-zero, it must be set to one of FirstOffset or LastOffset.
//
// Default: FirstOffset
//
// Only used when GroupID is set
StartOffset int64

// BackoffDelayMin optionally sets the smallest amount of time the reader will wait before
Expand Down Expand Up @@ -697,14 +695,19 @@ func NewReader(config ReaderConfig) *Reader {
version = 1
}

startOffset := FirstOffset
if config.StartOffset != 0 {
startOffset = config.StartOffset
}

stctx, stop := context.WithCancel(context.Background())
r := &Reader{
config: config,
msgs: make(chan readerMessage, config.QueueCapacity),
cancel: func() {},
commits: make(chan commitRequest, config.QueueCapacity),
stop: stop,
offset: FirstOffset,
offset: startOffset,
stctx: stctx,
stats: &readerStats{
dialTime: makeSummary(),
Expand Down