public static async Task <RabbitMQHostConfiguration> LoadConfiguration(string sectionName             = "platibus.rabbitmq",
                                                                               bool processConfigurationHooks = true)
        {
            var configManager = new RabbitMQHostConfigurationManager();
            var configuration = new RabbitMQHostConfiguration();
            await configManager.Initialize(configuration, sectionName);

            if (processConfigurationHooks)
            {
                await configManager.FindAndProcessConfigurationHooks(configuration);
            }
            return(configuration);
        }
Example #2
0
        private static async Task <RabbitMQHost> StartAsync(
            string configSectionName,
            Func <RabbitMQHostConfiguration, Task> configure,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            var configManager = new RabbitMQHostConfigurationManager();
            var configuration = new RabbitMQHostConfiguration();
            await configManager.Initialize(configuration, configSectionName);

#pragma warning disable 612
            await configManager.FindAndProcessConfigurationHooks(configuration);

#pragma warning restore 612
            if (configure != null)
            {
                await configure(configuration);
            }

            var server = await StartAsync(configuration, cancellationToken);

            return(server);
        }