-
Notifications
You must be signed in to change notification settings - Fork 127
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
kq下多Processors位移提交的问题 #28
Comments
我看了代码,认为也会是这样,会导致丢消息和重复消费 |
不会,因为channel是无容量的,多个goroutine一起消费也只会按顺序提交 |
为啥,consumeOne时间不确定,即使消费者按顺序,提交也不一定按顺序 |
kafka-go 会merge commit,这里面会按照message的offset排序的 |
看了一下源码,是有merge操作 但是上面只要大于就更新,不是连续的啊,比如现在有offset的2,3,4个消息处理,4先提交,那2,3都没提交,万一2,3失败了,是不是也相当于他们成功,下一次获取到5的消息 |
我也有同样的疑问,看起来是不是只能定义一个processer才能保证提交正常呀,是不是应该设计成像spring-kafka那样,每个consumer对应着一个消费线程,这样就可以保证提交不错乱了 |
感谢对
kafka-go
进行服务化封装,的确用起来更简单了!我对消费代码有个疑惑,望解答:
多个goroutine并行提交位移是否有问题?如提前把大位移提交导致丢消息,或滞后把小位移提交导致重复消费。
The text was updated successfully, but these errors were encountered: