Skip to content

Commit

Permalink
feat: kafka add field to control kafka auto commit offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
FGadvancer committed Apr 28, 2024
1 parent e92c626 commit 38d5a6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mq/kafka/consumer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type MConsumerGroup struct {
topics []string
}

func NewMConsumerGroup(conf *Config, groupID string, topics []string) (*MConsumerGroup, error) {
config, err := BuildConsumerGroupConfig(conf, sarama.OffsetNewest)
func NewMConsumerGroup(conf *Config, groupID string, topics []string, autoCommitEnable bool) (*MConsumerGroup, error) {
config, err := BuildConsumerGroupConfig(conf, sarama.OffsetNewest, autoCommitEnable)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion mq/kafka/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

func Check(ctx context.Context, conf *Config, topics []string) error {
kfk, err := BuildConsumerGroupConfig(conf, sarama.OffsetNewest)
kfk, err := BuildConsumerGroupConfig(conf, sarama.OffsetNewest, false)
if err != nil {
return err
}
Expand Down

0 comments on commit 38d5a6f

Please sign in to comment.