public void Dispose() { if (_running) { Shutdown(); } _consumer?.Dispose(); _consumer = null; _manager?.Dispose(); _manager = null; }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { lock (lockForDictionaryChange) { Logger.Info("Got lock Will dispose KafkaSimpleManager ..."); kafkaSimpleManage.Dispose(); kafkaSimpleManage = null; config = null; Logger.Info("Finish dispose KafkaSimpleManager ...will release lock."); } } disposed = true; } }