Merge pull request 'correction create opts' (#160) from devstigneev/micro-broker-kgo:fix_opts into v4
Reviewed-on: #160
This commit is contained in:
5
kgo.go
5
kgo.go
@@ -568,7 +568,8 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
|
|||||||
messagePool: messagePool,
|
messagePool: messagePool,
|
||||||
}
|
}
|
||||||
|
|
||||||
kopts := append(b.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()),
|
||||||
@@ -581,6 +582,8 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
|
|||||||
kgo.AutoCommitCallback(sub.autocommit),
|
kgo.AutoCommitCallback(sub.autocommit),
|
||||||
kgo.AutoCommitMarks(),
|
kgo.AutoCommitMarks(),
|
||||||
kgo.WithHooks(sub),
|
kgo.WithHooks(sub),
|
||||||
|
},
|
||||||
|
b.kopts...,
|
||||||
)
|
)
|
||||||
|
|
||||||
if options.Context != nil {
|
if options.Context != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user