private async Task ConsumeCommand(CancellationToken cancellationToken)
        {
            while (!cancellationToken.IsCancellationRequested)
            {
                var command = await _broker.ReadCommand(cancellationToken);

                using var scope = _scopeFactory.CreateScope();
                var handler = (CommandHandler)scope.ServiceProvider.GetService(CreateCommandHandlerTypeFor(command));
                await handler.Handle(command);
            }
        }