await producer.ProduceAsync() never return
See original GitHub issueDescription
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:
- Created 5 years ago
- Reactions:2
- Comments:37 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks for confirming @cmills2000 - the power of open source at work! I plan to get this resolved before the next release.
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