0

I have a Kafka producer with a 250 ms request.timeout.ms. All other configs are set to their default.

        var producerConfig = new ProducerConfig
        {
            Acks = Acks.All,
            RequestTimeoutMs = requestTimeoutMs
        };

I also have the following code:

        var stopwatch = Stopwatch.StartNew();
        await _KafkaProducer.ProduceAsync(kafkaTopic, kafkaMessage, cancellationToken);
        stopwatch.Stop();
        LogProduceLatency(stopwatch.ElapsedMilliseconds);

My understanding is that with my configs, if the ProduceAsync call takes more than 250 ms, it should timeout and retry. This should continue for delivery.timeout.ms (which, for me, is set to the default of 2 minutes). Instead, I see instances of ProduceAsync calls taking up to 900 ms.

Am I misunderstanding something here or is something else likely configured incorrectly? It seems to me that with my request.timeout.ms setting, I should never see a ProduceAsync call that takes more than 250 ms.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Imran
  • 385
  • 1
  • 2
  • 8

0 Answers0