Last active
May 10, 2023 08:36
-
-
Save vikrambiwal/c92c1ecba3344675d83e3da57cbebfd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client := &kafkago.Client{ | |
Addr: kafkago.TCP("127.0.0.1:9092"), | |
Timeout: 10 * time.Second, | |
} | |
ctx := context.Background() | |
descReq := &kafkago.DescribeGroupsRequest{ | |
GroupIDs: []string{"test-topic-group"}, | |
} | |
descResp, err := client.DescribeGroups(ctx, descReq) | |
if err != nil { | |
log.Fatalf("Error describing consumer group: %v", err) | |
} | |
if len(descResp.Groups) != 1 { | |
log.Fatalf("Expected to find one consumer group, but found %d", len(descResp.Groups)) | |
} | |
groupDesc := descResp.Groups[0] | |
members := groupDesc.Members | |
for _, member := range members { | |
log.Printf("Member: %+v", member) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment