private Connection GetConnection(RabbitMQServiceInfo info, IConfiguration configuration)
        {
            var rabbitConfig = new RabbitMQProviderConnectorOptions(configuration);
            var configurer   = new RabbitMQProviderConfigurer();

            return(new Connection(configurer.Configure(info, rabbitConfig), "RabbitMQ", info));
        }
        public Connection Get(IConfiguration configuration, string serviceName)
        {
            var info = serviceName == null
              ? configuration.GetSingletonServiceInfo <RabbitMQServiceInfo>()
              : configuration.GetRequiredServiceInfo <RabbitMQServiceInfo>(serviceName);

            var rabbitConfig = new RabbitMQProviderConnectorOptions(configuration);
            var configurer   = new RabbitMQProviderConfigurer();

            return(new Connection
            {
                ConnectionString = configurer.Configure(info, rabbitConfig),
                Name = "RabbitMQ" + serviceName?.Insert(0, "-")
            });
        }