设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 手机 数据
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Kafka之消费与激情(6)

发布时间:2021-05-29 18:39 所属栏目:118 来源:互联网
导读://Wedonotwanttobestuckblockinginpollifwearemissingsomepositions //sincetheoffsetlookupmaybebackingoffafterafailure //NOTE:theuseofcachedSubscriptionHashAllFetchPositionsmeansweMUSTcall //updateAssign

        // We do not want to be stuck blocking in poll if we are missing some positions  

        // since the offset lookup may be backing off after a failure  

        // NOTE: the use of cachedSubscriptionHashAllFetchPositions means we MUST call  

        // updateAssignmentMetadataIfNeeded before this method.  

        if (!cachedSubscriptionHashAllFetchPositions && pollTimeout > retryBackoffMs) {  

            pollTimeout = retryBackoffMs;  

        }  

        client.poll(pollTimeout, startMs, () -> {  

            // since a fetch might be completed by the background thread, we need this poll condition  

            // to ensure that we do not block unnecessarily in poll()  

            return !fetcher.hasCompletedFetches();  

        });  

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读