correction create opts
This commit is contained in:
5
kgo.go
5
kgo.go
@@ -477,7 +477,8 @@ func (k *Broker) Subscribe(ctx context.Context, topic string, handler broker.Han
|
|||||||
connected: k.connected,
|
connected: k.connected,
|
||||||
}
|
}
|
||||||
|
|
||||||
kopts := append(k.kopts,
|
kopts := append(
|
||||||
|
[]kgo.Opt{
|
||||||
kgo.ConsumerGroup(options.Group),
|
kgo.ConsumerGroup(options.Group),
|
||||||
kgo.ConsumeTopics(topic),
|
kgo.ConsumeTopics(topic),
|
||||||
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
|
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
|
||||||
@@ -490,6 +491,8 @@ func (k *Broker) Subscribe(ctx context.Context, topic string, handler broker.Han
|
|||||||
kgo.AutoCommitCallback(sub.autocommit),
|
kgo.AutoCommitCallback(sub.autocommit),
|
||||||
kgo.AutoCommitMarks(),
|
kgo.AutoCommitMarks(),
|
||||||
kgo.WithHooks(sub),
|
kgo.WithHooks(sub),
|
||||||
|
},
|
||||||
|
k.kopts...,
|
||||||
)
|
)
|
||||||
|
|
||||||
if options.Context != nil {
|
if options.Context != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user