Skip to content

Commit

Permalink
Merge pull request #185 from konart/fix_npe
Browse files Browse the repository at this point in the history
Fix null pointer exception in sigterm
  • Loading branch information
d-rk authored Jan 18, 2024
2 parents b279ead + b0d5db0 commit b1ae729
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/consume/GroupConsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ func (handler *groupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, c

for {
select {
case message := <-messageChannel:
if message != nil {
handler.messages <- message
case message, ok := <-messageChannel:
if !ok {
output.Debugf("consume claim via channel interrupted")
handler.cancel()
return nil
}
handler.messages <- message
session.MarkMessage(message, "")
case <-handler.stopConsumers:
output.Debugf("stop consume claim via channel")
Expand Down

0 comments on commit b1ae729

Please sign in to comment.