关于auto.offset.reset的一些问题
来源:互联网 发布:淘宝内置密码有什么用? 编辑:程序博客网 时间:2024/06/06 01:53
转自:http://blog.csdn.net/luoww1/article/details/52023967
关于auto.offset.reset的一些问题
auto.offset.reset 默认值为largest,那么auto.offset.reset 有什么作用呢?auto.offset.reset定义了Consumer在ZooKeeper中发现没有初始的offset时或者发现offset非法时定义Comsumer的行为,常见的配置有:
- smallest : 自动把offset设为最小的offset;
- largest : 自动把offset设为最大的offset;
- anything else: 抛出异常;
遇到过这种情况:先produce一些数据,然后停止produce数据的线程——〉然后再用consumer上面的代码消费数据,发现无数据可消费!
其原因在于:初始的offset默认是非法的,而auto.offset.reset 默认值为largest,表示自动把offset设为最大的offset,由于此时没有生产者向kafka push数据,当然没有数据可以消费了。如果此时有生产者向kafka push数据,那么该代码可以从最新位置消费数据。
阅读全文
0 0
- 关于auto.offset.reset的一些问题
- auto.offset.reset解释
- auto.offset.reset 说明
- auto.offset.reset介绍
- kafka auto.offset.reset介绍
- kafka 设置auto.offset.reset
- SparkStreaming中Kafak参数auto.offset.reset的说明
- Kafka auto.offset.reset值详解
- Kafka 0.10.2<auto.offset.reset和enable.auto.commit>
- DrawImage offset的问题
- 关于css 的reset
- 关于offsetLeft与position:relative,margin:auto;的一些关系
- 关于Ext.form.FormPanel的reset方法的问题
- 关于Android测试中ADB reset失败的问题
- 关于JAVA httpclient connection reset的问题分析和解决
- 关于Android测试中ADB reset失败的问题
- reset的失效问题
- AUTO INCREMENT Reset
- Druid 介绍及配置
- Spring自定义缓存管理及配置Ehcache缓存
- Git命令经验总结
- Guys, what is better than sex?
- angular代码实例一
- 关于auto.offset.reset的一些问题
- 个人笔记
- SpringBoot学习:IDEA中快速搭建springboot项目
- 跳跃游戏
- phpStudy配置详解(window)
- 4.3(5)
- java中continue和break的区别
- oracle 时间格式化会多出12小时
- 谈谈热点账户(二) 天顺 · 1 个月前