summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--consumer.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/consumer.go b/consumer.go
index a8c6346..b9c1b45 100644
--- a/consumer.go
+++ b/consumer.go
@@ -29,6 +29,17 @@ func main() {
os.Exit(1)
}
+ partitions, err := c.Assignment()
+ if err != nil {
+ fmt.Printf("Failed to get assignments: %s", err)
+ os.Exit(1)
+ }
+
+ fmt.Printf("Consuming %d partitions: \n", len(partitions))
+ for i, partition := range partitions {
+ fmt.Printf(" #%d: %s\n", i+1, partition.String())
+ }
+
topic := "purchases"
err = c.SubscribeTopics([]string{topic}, nil)
// Set up a channel for handling Ctrl-C, etc