producer-1] WARN o.apache.kafka.clients.NetworkClient: brokers may not be available

问题描述 投票:0回答:1
Project details:

Gradle project

kafka-clients-0.11.0.0

And please do bare with this type of vague question. I'm not able to give the complete details due to company policies and that I won't be able to copy paste the errors as this site is not accessible in my company's virtual machine.

  1. I'm a beginner in KAFKA. I was assigned a simple task to enable the producer to retry upon send failure. We have already added a kafka producer callback for this send() method, that just logs the ...

  1. 我是KAFKA的初学者。我被分配了一个简单的任务,让生产者在发送失败时重试。我们已经为这个send()方法添加了一个kafka producer回调,只记录响应(在引入重试之前)。

  2. 我的目标是:最多尝试5次重试。如果生产者send()方法失败,最多重试5次,如果最后一次重试也失败了,就写一个日志,说明在重试5次后发送消息的尝试失败了。

    我做了如下操作。

retries = 5

  1. retry.backoff.ms =35000 (设置时假设这个重试间隔应该大于request.timeout.ms(30000 ms)--虽然不确定这个)
  2. 试着给一个经纪人,是下降 - 失败的生产者发送(),所以我可以检查,如果重试配置工作[max.in.flight.requests.per.connection没有设置为1,因为排序是不重要的我们。]

我想知道以下几点。

kafka是否以任何方式记录重试的尝试?- 例如:在每次尝试时记录 "retrying...",或者在所有重试结束时记录 "失败后n次重试"。
apache-kafka kafka-producer-api retry-logic
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.