Closed usernameisnull closed 1 year ago
another talk: what the default consumer group id is?
I get sth, in the code I specify the partition, so multiple application can cosume the message
Sarama 之前是不支持消费组的,现在的版本有,官方有示例:
https://github.com/Shopify/sarama/blob/master/examples/consumergroup/main.go
但之前的使用经验下来感觉并不稳定,有一些怪问题,在某大型企业内部踩过坑。
Sarama has no support for consumer group before, the one merged by pull request is not yet stable now in my experience.
Sarama 之前是不支持消费组的,现在的版本有,官方有示例:
https://github.com/Shopify/sarama/blob/master/examples/consumergroup/main.go
但之前的使用经验下来感觉并不稳定,有一些怪问题,在某大型企业内部踩过坑。
Sarama has no support for consumer group before, the one merged by pull request is not yet stable now in my experience.
那kafka本身是怎么处理这种没有指定消费组的行为的呢?
单客户端消费不需要组,组只是用来协调多客户端的。
单客户端消费不需要组,组只是用来协调多客户端的。 不,我也是多个应用程序连上去的,这也算多客户端吧
Sarama 之前是不支持消费组的,现在的版本有,官方有示例:
https://github.com/Shopify/sarama/blob/master/examples/consumergroup/main.go
但之前的使用经验下来感觉并不稳定,有一些怪问题,在某大型企业内部踩过坑。
Sarama has no support for consumer group before, the one merged by pull request is not yet stable now in my experience.
我们目前也在生产环境使用,目前来看,还是稳定,你可以说下具体的问题吗?
@antsbean 当创建多个不同的名称的consumer-group会导致出现无法消费的问题
@antsbean 有些旧集群会直接连接不上,和 sarama 版本还有关系的,报错比较奇怪,当时没记录下来,直接降低 sarama 版本解决了。
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
mark 一下,希望有大佬解答一下
单消费者没有组的概念,单消费者消费时必须要指定消费哪个数据分片,像提问者贴的代码里就有这一句。
pc, err := client.ConsumePartition("topic.sarama", 0, sarama.OffsetNewest)
if err != nil {
panic(err)
}
如果是消费组的话,这一句是不存在的,服务器自动帮你分配了哪一块数据交给组内的哪个消费者去读取。
所以回答就是没有组,因为只是新建了一个消费者,不是消费组。
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
Closing as believed to have been resolved
Versions
Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Configuration
What configuration values are you using for Sarama and Kafka?
Logs
When filing an issue please provide logs from Sarama and Kafka if at all possible. You can set
sarama.Logger
to alog.Logger
to capture Sarama debug output.logs: CLICK ME
``` ```
Problem Description
I run command in the machine where kafka is:
KMOffsetCache-ubuntu18
is the group of my application use?KMOffsetCache-ubuntu18
, the multiple application use one group?topic.sarama
) only one partition, but all applications can get the message,so:KMOffsetCache-ubuntu18
get?