Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): sync exactly_once and consumergroup #2614

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/consumergroup/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/IBM/sarama/examples/consumer

go 1.16

require github.com/IBM/sarama v1.34.1
require github.com/IBM/sarama v1.40.1

replace github.com/IBM/sarama => ../../
501 changes: 20 additions & 481 deletions examples/consumergroup/go.sum

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions examples/consumergroup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
// SIGUSR1 toggle the pause/resume consumption
import (
"context"
"errors"
"flag"
"log"
"os"
Expand Down Expand Up @@ -106,6 +107,9 @@ func main() {
// server-side rebalance happens, the consumer session will need to be
// recreated to get the new claims
if err := client.Consume(ctx, strings.Split(topics, ","), &consumer); err != nil {
if errors.Is(err, sarama.ErrClosedConsumerGroup) {
return
}
log.Panicf("Error from consumer: %v", err)
}
// check if context was cancelled, signaling that the consumer should stop
Expand Down
2 changes: 1 addition & 1 deletion examples/exactly_once/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/IBM/sarama/examples/exactly_once

go 1.16

require github.com/IBM/sarama v1.34.1
require github.com/IBM/sarama v1.40.1

replace github.com/IBM/sarama => ../../
Loading
Loading