C# IProducer.Produce Does Not Call Delivery Report Handler

Hi, I’m trying to create the most basic scenario, pretty much as described here: Kafka .NET Client | Confluent Documentation, and I’ve added a thread sleep loop to keep the main method from exiting too quickly, nonetheless, the delivery handler never gets called - any help would be much appreciated:

Hi,

From looking at this code - how would you know if the DeliveryReportHandler get’s called? i.e., I don’t see any logging, etc. Also, for the BootstrapServers config, is it set to DummyServer to hide the actual broker address, or did you do that to force an error? If the answer is yes to the latter, the producer will never send the record as it can’t connect, hence no call to the delivery report.

Thank you so much for getting back to me. The reason I know the handler is not being called is because I had a break point there in the debugger, and yes, the latter, I was trying to force an error - so far I have found that if the Producer is not-properly configured, there is no error, and no exception(s) are thrown. The only “hint” of error that I find, is when awaiting the ProduceAsync() version, and then drilling-into the result, there is “result = NotCommitted” construct. In my opinion, it should throw an exception with clear message … but again, thanks for the response, if this is expected under the circumstances then it is what it is … moving forward …