bsm/sarama-cluster

consumer group Owner

Closed this issue · 5 comments

Version

Sarama Version: 1.13.0 (2017-10-04)
Kafka Version: kafka_2.11-0.10.1.0
Go Version: 1.9.2 darwin/amd64

Configuration
Logs
Problem Description

how to set consumer group's owner name?
when I exec:
./kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group g1
then output:
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG OWNER
g1 integration 0 319587936 352119221 32531285 none
OWNER is 'none'.

I want to know hot to set consumer group's OWNER in sarama-cluster please?

dim commented

This lib doesn't support zookeeper-based offset management, please try ./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group g1

thank you for your answer
i run:
./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group g1
then output:
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG OWNER
g1 integration 0 319587936 352119221 32531285 sarama/172.21.0.4

I want to know how to set OWNER in sarama-cluater

dim commented

What version of Kafka are you using? There is no mentioning of Owner in https://kafka.apache.org/protocol#The_Messages_DescribeGroups, so I am not sure which field Owner is actually mapped to. If it's metadata, then you can set it via MarkOffset

I use "kafka_2.11-0.10.1.0"
and when I in kafka_2.11-0.10.1.0/bin dir run:
./kafka-consumer-groups.sh --describe --bootstrap-server localhost:8410 --group alarm-states-store
then output:
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG OWNER
alarm-states-store alarm-states 0 939384 939384 0 sarama_/172.21.49.5
the OWNER is "sarama_/172.21.49.5"
I am also not sure which field Owner is actually mapped to
Maybe Iit is "member id" or "consumer id"
the consumer group is created by sarama-cluster:
consumer, err := cluster.NewConsumer(brokers, groupID, []string{topic}, kafkaConfig)
and I want to know how to set owner as a customer value?
thank you

dim commented

Oh, I see now. This can be set in the sarama config, please see https://github.com/Shopify/sarama/blob/298679cecd2f09c9b7ddd73ad83dbd76dd0e513f/config.go#L250