protected function getConnectionConfig($name)
    {
        $connections = $this->getConfig()['connections'];
        if (!isset($connections[$name])) {
            throw new InvalidArgumentException(sprintf('The pub-sub connection [%s] is not configured.', $name));
        }

        $config = $connections[$name];

        if (isset($config['subscribe_connection'])) {
            $config['subscribe_connection_config'] = $this->getConnectionConfig($config['subscribe_connection']);
        }

        return $config;
    }