correction create opts
This commit is contained in:
29
kgo.go
29
kgo.go
@@ -568,19 +568,22 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
|
|||||||
messagePool: messagePool,
|
messagePool: messagePool,
|
||||||
}
|
}
|
||||||
|
|
||||||
kopts := append(b.kopts,
|
kopts := append(
|
||||||
kgo.ConsumerGroup(options.Group),
|
[]kgo.Opt{
|
||||||
kgo.ConsumeTopics(topic),
|
kgo.ConsumerGroup(options.Group),
|
||||||
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
|
kgo.ConsumeTopics(topic),
|
||||||
kgo.FetchMaxWait(1*time.Second),
|
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
|
||||||
kgo.AutoCommitInterval(commitInterval),
|
kgo.FetchMaxWait(1 * time.Second),
|
||||||
kgo.OnPartitionsAssigned(sub.assigned),
|
kgo.AutoCommitInterval(commitInterval),
|
||||||
kgo.OnPartitionsRevoked(sub.revoked),
|
kgo.OnPartitionsAssigned(sub.assigned),
|
||||||
kgo.StopProducerOnDataLossDetected(),
|
kgo.OnPartitionsRevoked(sub.revoked),
|
||||||
kgo.OnPartitionsLost(sub.lost),
|
kgo.StopProducerOnDataLossDetected(),
|
||||||
kgo.AutoCommitCallback(sub.autocommit),
|
kgo.OnPartitionsLost(sub.lost),
|
||||||
kgo.AutoCommitMarks(),
|
kgo.AutoCommitCallback(sub.autocommit),
|
||||||
kgo.WithHooks(sub),
|
kgo.AutoCommitMarks(),
|
||||||
|
kgo.WithHooks(sub),
|
||||||
|
},
|
||||||
|
b.kopts...,
|
||||||
)
|
)
|
||||||
|
|
||||||
if options.Context != nil {
|
if options.Context != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user