解决librdkafka 报WARN:Protocol read buffer underflow
https://github.com/edenhill/librdkafka/issues/1660
RT,公司的kafka更换了版本, 用到librdkafka的场景就开始报这条警告
解决方式如下:
在初始化的时候,修改相关配置
constchar*api_version_request="false";constchar*api_version_fallback="0.8.2.0";if(rd_kafka_conf_set(g_rkconf,"api.version.request",api_version_request,errstr,sizeof(errstr))!=RD_KAFKA_CONF_OK){fprintf(stderr,"%s\n",errstr);exit(0);}if(rd_kafka_conf_set(g_rkconf,"broker.version.fallback",api_version_fallback,errstr,sizeof(errstr))!=RD_KAFKA_CONF_OK){fprintf(stderr,"%s\n",errstr);exit(0);}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。