public function process(ContainerBuilder $container)
    {
        $serviceId = 'simple_bus.asynchronous.publishes_predefined_messages_middleware';
        if (!$container->hasDefinition($serviceId)) {
            return;
        }

        $names = array();
        $this->collectServiceIds(
            $container,
            'asynchronous_event_subscriber',
            'subscribes_to',
            function ($key) use (&$names) {
                $names[] = $key;
            }
        );

        $container->getDefinition($serviceId)->replaceArgument(2, array_unique($names));
    }