System.ObjectDisposedException: handle is destroyed

Viewed 983

Kafka consumer application is throwing ObjectDisposedException when we initiate the process to stop the consumer service.I would like to understand what process destroyed the kafka handle

System.ObjectDisposedException: handle is destroyed
at Confluent.Kafka.Impl.SafeKafkaHandle.ThrowIfHandleClosed()
at Confluent.Kafka.Consumer`2.Consume(Int32 millisecondsTimeout)
at Confluent.Kafka.Consumer`2.Consume(CancellationToken cancellationToken)
1 Answers

in my case this exception was thrown in .Net Library Confluent Kafka. If you are also using this library, please make sure what you call Consumer.Close() BEFORE Consumer.Dispose().

Related