Ejemplo n.º 1
0
        Task <IStartableEndpoint> PerformConfiguration(Action <EndpointConfiguration> moreConfiguration = null)
        {
            var configuration = new EndpointConfiguration(endpointNameToUse);

            configuration.DefineCriticalErrorAction(OnCriticalError);

            moreConfiguration?.Invoke(configuration);

            specifier.Customize(configuration);
            profileManager.ActivateProfileHandlers(configuration);

            return(Endpoint.Create(configuration));
        }
Ejemplo n.º 2
0
        public async Task Start()
        {
            try
            {
                var endpointConfiguration = new NServiceBus.EndpointConfiguration(EndpointName);

                //These 2 settings happen for all endpoints
                endpointConfiguration.DefineCriticalErrorAction(OnCriticalError);
                endpointConfiguration.UseContainer <StructureMapBuilder>(x => x.ExistingContainer(container));

                foreach (var configure in configs)
                {
                    configure.Configure(endpointConfiguration);
                }

                endpoint = await Endpoint.Start(endpointConfiguration);
            }
            catch (Exception ex)
            {
                FailFast("Failed to start.", ex);
            }
        }
Ejemplo n.º 3
0
        Task <IStartableEndpoint> PerformConfiguration(Action <EndpointConfiguration> moreConfiguration = null)
        {
            var loggingConfigurers = profileManager.GetLoggingConfigurer();

            foreach (var loggingConfigurer in loggingConfigurers)
            {
                loggingConfigurer.Configure(specifier);
            }

            var configuration = new EndpointConfiguration(endpointNameToUse);

            SetSlaFromAttribute(configuration, specifier);

            configuration.DefineCriticalErrorAction(OnCriticalError);

            moreConfiguration?.Invoke(configuration);

            specifier.Customize(configuration);
            RoleManager.TweakConfigurationBuilder(specifier, configuration);
            profileManager.ActivateProfileHandlers(configuration);

            return(Endpoint.Create(configuration));
        }