System.ObjectDisposedException: handle is destroyed
Asked Answered
A

1

10

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)
Affiche answered 12/8, 2020 at 22:56 Comment(0)
E
1

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().

Emrick answered 6/7, 2022 at 9:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.