Kafka消费异常

Kafka消费异常

[INFO ] [2021-04-22 09:59:30.899]  org.apache.kafka.clients.consumer.internals.AbstractCoordinator.coordinatorDead  Marking the coordinator localhost:9094 (id: 2147483645 rack: null) dead for group rc-bond-rates-grade-sit
[INFO ] [2021-04-22 09:59:30.916]  org.apache.kafka.clients.consumer.internals.AbstractCoordinator$GroupCoordinatorResponseHandler.onSuccess  Discovered coordinator 192.168.75.53:9094 (id: 2147483645 rack: null) for group rc-bond-rates-grade-sit.
[ERROR] [2021-04-22 09:59:30.971]  org.apache.kafka.clients.consumer.internals.ConsumerCoordinator$DefaultOffsetCommitCallback.onComplete  Offset commit with offsets {rc-bond-rates-0=OffsetAndMetadata{offset=0, metadata=''}} failed for group rc-bond-rates-grade-sit
org.apache.kafka.clients.consumer.CommitFailedException: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records.
    at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator$OffsetCommitResponseHandler.handle(ConsumerCoordinator.java:792) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator$OffsetCommitResponseHandler.handle(ConsumerCoordinator.java:738) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.AbstractCoordinator$CoordinatorResponseHandler.onSuccess(AbstractCoordinator.java:808) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.AbstractCoordinator$CoordinatorResponseHandler.onSuccess(AbstractCoordinator.java:788) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.RequestFuture$1.onSuccess(RequestFuture.java:204) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.RequestFuture.fireSuccess(RequestFuture.java:167) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.RequestFuture.complete(RequestFuture.java:127) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient$RequestFutureCompletionHandler.fireCompletion(ConsumerNetworkClient.java:488) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.firePendingCompletedRequests(ConsumerNetworkClient.java:348) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:262) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:208) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1096) ~[kafka-clients-0.11.0.1.jar!/:?]
    at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1043) ~[kafka-clients-0.11.0.1.jar!/:?]
    at com.yhfin.risk.dto.message.ParentMessage.lambda$startReceiveMessage$0(ParentMessage.java:95) ~[refactor-risk-project-api-2.2.3.jar!/:2.2.3]
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_271]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_271]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_271]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]
[INFO ] [2021-04-22 09:59:30.971]  org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.onJoinPrepare  Revoking previously assigned partitions [rc-bond-rates-0] for group rc-bond-rates-grade-sit
[INFO ] [2021-04-22 09:59:30.972]  org.apache.kafka.clients.consumer.internals.AbstractCoordinator.sendJoinGroupRequest  (Re-)joining group rc-bond-rates-grade-sit
[INFO ] [2021-04-22 09:59:31.028]  org.apache.kafka.clients.consumer.internals.AbstractCoordinator$1.onSuccess  Successfully joined group rc-bond-rates-grade-sit with generation 17
[INFO ] [2021-04-22 09:59:31.028]  org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.onJoinComplete  Setting newly assigned partitions [rc-bond-rates-0] for group rc-bond-rates-grade-sit

 

原因:

     group.id:rc-bond-rates-grade-sit对应的topic处理消息速度过慢,导致超出kafka心跳时间,然后broker认为消费者挂了,重新rebalance。

解决:

    把消息丢到消息队列异步处理。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值