kafka使用过程中遇到的问题

1消费端的不消费
消费端有一个配置,叫 fetch.message.max.bytes,默认是1M,此时如果有消息大于1M,会发生停止消费的情况。
此时,在配置中增加 props.put("fetch.message.max.bytes", "10485760"); 即可
异常ConsumerRebalanceFailedException
确保 rebalance.max.retries * rebalance.backoff.ms > zookeeper.session.timeout.ms (默认符合,如果机器较多,或者消费的Topic较多,建议rebalance.max.retries设置大一点)

猜你喜欢

转载自lsh2366254.iteye.com/blog/2395486