Skip to content

Commit

Permalink
fixed deprecation-warning for consumer-group-rebalancing
Browse files Browse the repository at this point in the history
  • Loading branch information
ninlil committed Apr 6, 2023
1 parent 0612663 commit 8b917cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kafka-input.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ func (r *kafkaReceiver) Connect() (Consumer, error) {
cfg := sarama.NewConfig()
cfg.ClientID = fmt.Sprintf("melp-reader-%s", r.ID)

//cfg.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategySticky
cfg.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategyRoundRobin
// Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used.
// Please use Consumer.Group.Rebalance.GroupStrategies
//
// using sticky to minimize rebalancing
cfg.Consumer.Group.Rebalance.GroupStrategies = []sarama.BalanceStrategy{sarama.BalanceStrategySticky}

r.Endpoint.SetConfig(cfg)

Expand Down

0 comments on commit 8b917cd

Please sign in to comment.