protected override async Task StopAgent(StopContext context) { await _consumerContext.Close().ConfigureAwait(false); _consumerContext.ErrorHandler -= HandleKafkaError; LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress); SetCompleted(ActiveAndActualAgentsCompleted(context)); await Completed.ConfigureAwait(false); }