question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

await producer.ProduceAsync() never return

See original GitHub issue

Description

In a C# Windows service application, await producer.ProduceAsync() never return. but the message have sent and consumer received it. This issue both occurred in Confluent.Kafka nuget package of 0.11.6 & 1.0.0 beta3.

Add: Just tested other version and found:

  • Confluent.Kafka 0.11.2 & librdkkafka.redist 0.11.1: Works
  • Confluent.Kafka 0.11.3 & librdkkafka.redist 0.11.3: Works
  • Confluent.Kafka 0.11.4 & librdkkafka.redist 0.11.4: Does not works
  • Confluent.Kafka 0.11.5 & librdkkafka.redist 0.11.5: Does not works
  • Confluent.Kafka 0.11.6 & librdkkafka.redist 0.11.6: Does not works

How to reproduce

var config = new ProducerConfig
 {
      BootstrapServers = "server:9092",
      MessageTimeoutMs = 5000
};
var _producer = new ProducerBuilder<Null, string>(config).Build();

var message = new { Time = DateTime.Now };

LogHelper.Debug("Producer start...");

await _producer.ProduceAsync("myTopic", new Message<Null, string>{ Value = JsonConvert.SerializeObject(message)});

LogHelper.Debug("Producer end...");   //this line never executed

Checklist

Please provide the following information:

  • Confluent.Kafka nuget version: 0.11.6 & 1.0.0-beta3
  • Apache Kafka version: 2.11
  • Client configuration: .NET Framework 4.6.2
  • Operating system: Windows Server 2016
  • Provide logs (with “debug” : “…” as necessary in configuration)
  • Provide broker log excerpts
  • Critical issue

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:37 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
mhowlettcommented, Mar 7, 2019

thanks for confirming @cmills2000 - the power of open source at work! I plan to get this resolved before the next release.

1reaction
raldescommented, Feb 5, 2021

I had the same error “await producer async never return”. The cause was SSL wrong configuration. My recomendation: set the Debug config property to “all” and see the log

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka producer with Async not returning DeliveryReport but ...
I think i got the solution: using (var producer = new ProducerBuilder<string, string>(this._config).Build()) { try { var deliveryResult ...
Read more >
Kafka .NET Client
The Task returned by ProduceAsync will not complete until the success (or otherwise) of the request is known. As such, await``ing the ``ProduceAsync...
Read more >
Working with Apache Kafka in ASP.NET 6 Core
Kafka Producer: A Kafka producer serves as a data source for one or more Kafka topics and is responsible for writing, optimizing, and...
Read more >
Building Reliable Kafka Producers and Consumers in .NET
In this model, a consumer commits the offsets after processing the batch of messages it receives from Kafka. In case of an error,...
Read more >
.Net Publish to Kafka topic (efficiently) | by Jai Rathore ...
Net 6 web applications with Kafka for both producing as well ... ProduceAsync(topic, message); public void Produce( ... await producer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found