ProduceAsync still deadlocks for nuget version: Confluent.Kafka -Version 1.0.0-experimental-12
See original GitHub issueDescription
I upgraded to Confluent.Kafka -Version 1.0.0-experimental-12
according to what you mentioned here. If I am not wrong, this package includes 1.0-experimental-9
.
But I still see ProduceAsync
deadlock (for a console application). I added debug: all in the config and captures the following log:
Here is the relevant code:
var config = new Dictionary<string, object> {
{ "bootstrap.servers", "192.168.0.228:9092" },
{ "queue.buffering.max.ms", 1 },
{ "socket.blocking.max.ms", 1 },
{ "debug", "all"}
};
_producer = new Producer<string, string>(config, new StringSerializer(Encoding.UTF8), new StringSerializer(Encoding.UTF8));
public void Publish<T>(T message) where T : IExternalMessage
{
if (message == null) throw new ArgumentNullException("message");
var value = JsonConvert.SerializeObject(message, ExternalMessageConverters.SerializerSettings);
Logger.Info("Publishing External Message: " + message.GetType().FullName + "\r\n" + value);
var partition = new TopicPartition(_topicNamePrefix + message.Topic, new Partition(message.PartitionKey % 20));
var m = new Message<string, string>
{
Key = message.Key,
Value = value
};
Console.WriteLine("BEGIN ProduceAsync: {0}", DateTime.Now);
_producer.ProduceAsync(partition, m).Wait();
Console.WriteLine("END ProduceAsync: {0}", DateTime.Now);
//AsyncContext.Run(async () =>
//{
//});
Logger.Info("DONE Publishing Message");
}
The entire log is attached below:
How to reproduce
Checklist
Please provide the following information:
- Confluent.Kafka nuget version: Confluent.Kafka -Version 1.0.0-experimental-12
- Apache Kafka version: kafka_2.11-2.0.0
- Client configuration: see code above
- Operating system: Client runs on Windows 7 (my dev machine). Kafka Server runs in Ubuntu 14.04.5 LTS
- Provide logs (with “debug” : “…” as necessary in configuration)
- Provide broker log excerpts
- Critical issue
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Kafka .NET Client
NET library that provides a high-level Producer, Consumer and AdminClient compatible with all Apache Kafka® brokers version 0.8 and later, Confluent Cloud ...
Read more >Supported Versions and Interoperability for Confluent ...
This topic provides the supported versions and interoperability of Confluent Platform and its components. Confluent Platform and Apache Kafka compatibility¶ ...
Read more >Confluent.Kafka 2.2.0
Confluent.Kafka 2.2.0 .NET 6.0 .NET Standard 1.3 .NET Framework 4.6.2 .NET CLI; Package Manager; PackageReference; Paket CLI; Script & Interactive; Cake.
Read more >Install Clients | Confluent Platform 5.1.4
Install Clients¶. Confluent Platform includes client libraries for multiple languages that provide both low level access to Apache Kafka® ...
Read more >Confluent Platform 7.4 Release Notes
7.4 is a major release of Confluent Platform that provides you with Apache Kafka® 3.4, the latest stable version of Kafka. The technical...
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 the input @foresightyj. re-opening as a reminder to investigate further.
There is also possibility, that using Task.Wait() on asynchronous method (which is ProduceAsync) causes deadlock. If you want to execute async method synchronously, you should use GetAwaiter().GetResult()