public function process(ContainerBuilder $container)
    {
        $this->setupPools($container);
        
        $pools = $container->getParameter('gendoria_command_queue.pools');

        foreach ($container->findTaggedServiceIds(self::QUEUE_MANAGER_TAG) as $id => $tags) {
            $def = $container->getDefinition($id);
            $reflection = new ReflectionClass($def->getClass());
            if ($reflection->implementsInterface(MultipleQueueManagerInterface::class)) {
                $this->setupMultipleQueueManager($id, $def, $tags, $pools);
            } elseif ($reflection->implementsInterface(SingleQueueManagerInterface::class)) {
                $this->setupSingleQueueManager($id, $def, $tags, $pools);
            } else {
                throw new InvalidArgumentException(sprintf('Service "%s" does not implement one of required interfaces.', $id));
            }
        }
    }