Merge pull request 'correction create opts' (#160) from devstigneev/micro-broker-kgo:fix_opts into v4
Some checks failed
coverage / build (push) Failing after 3m15s
test / test (push) Failing after 17m25s
sync / sync (push) Failing after 22s

Reviewed-on: #160
This commit was merged in pull request #160.
This commit is contained in:
2026-01-30 09:58:17 +03:00

7
kgo.go
View File

@@ -568,11 +568,12 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
messagePool: messagePool,
}
kopts := append(b.kopts,
kopts := append(
[]kgo.Opt{
kgo.ConsumerGroup(options.Group),
kgo.ConsumeTopics(topic),
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
kgo.FetchMaxWait(1*time.Second),
kgo.FetchMaxWait(1 * time.Second),
kgo.AutoCommitInterval(commitInterval),
kgo.OnPartitionsAssigned(sub.assigned),
kgo.OnPartitionsRevoked(sub.revoked),
@@ -581,6 +582,8 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
kgo.AutoCommitCallback(sub.autocommit),
kgo.AutoCommitMarks(),
kgo.WithHooks(sub),
},
b.kopts...,
)
if options.Context != nil {