confluent-kafka-dotnet
confluent-kafka-dotnet copied to clipboard
Provide a way to unsubscribe from LogHandler/ErrorHandler
Description
There is currently no way to remove the referenced Actions from Producer/Consumer which might cause a memory leak.
var producer = new ProducerBuilder<string, string>(producerConfig)
.SetLogHandler(LogHandler)
.Build();
How to reproduce
Confluent.Kafka 2.3.0 librdkafka 2.3.0
Checklist
Please provide the following information:
- [ ] A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
- [x] Confluent.Kafka nuget version.
- [x] Apache Kafka version.
- [ ] Client configuration.
- [ ] Operating system.
- [ ] Provide logs (with "debug" : "..." as necessary in configuration).
- [ ] Provide broker log excerpts.
- [ ] Critical issue.
What is the scenario for memory leaking? When you're done with the producer, the handlers would go with it.
Can you provide more details?
I am not sure what more details you want me to provide. I need a way to unsubscribe/unset reference to error/log handlers actions as described in the issue's title and description. Namely
ProducerBuilder<,>.ErrorHandler
ProducerBuilder<,>.LogHandler
Producer<,>.errorHandler
Producer<,>.logHandler