Exemplo n.º 1
0
        public void Setup()
        {
            if (_endpointFactoryConfigurator != null)
            {
                IConfigurationResult result = ConfigurationResult.CompileResults(_endpointFactoryConfigurator.Validate());

                try
                {
                    EndpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory();
                    //	_endpointFactoryConfigurator = null;

                    _endpointCache = new EndpointCache(EndpointFactory);

                    EndpointCache = new EndpointCacheProxy(_endpointCache);
                }
                catch (Exception ex)
                {
                    throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex);
                }
            }

            ServiceBusFactory.ConfigureDefaultSettings(x =>
            {
                x.SetEndpointCache(EndpointCache);
                x.SetConcurrentConsumerLimit(4);
                x.SetReceiveTimeout(50.Milliseconds());
                x.EnableAutoStart();
                x.DisablePerformanceCounters();
            });

            EstablishContext();
        }
Exemplo n.º 2
0
        protected IEndpointFactory BuildEndpointFactory()
        {
            IConfigurationResult result = ConfigurationResult.CompileResults(_endpointFactoryConfigurator.Validate());

            IEndpointFactory endpointFactory;

            try
            {
                endpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory();
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex);
            }
            return(endpointFactory);
        }
Exemplo n.º 3
0
        public static EndpointCache New([NotNull] Action <IEndpointFactoryConfigurator> configure)
        {
            Guard.AgainstNull(configure, "configure");

            var configurator = new EndpointFactoryConfigurator(_defaultSettings);

            configure(configurator);

            IConfigurationResult result = ConfigurationResult.CompileResults(configurator.Validate());

            try
            {
                IEndpointFactory endpointFactory = configurator.CreateEndpointFactory();

                var endpointCache = new EndpointCache(endpointFactory);

                return(endpointCache);
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex);
            }
        }
Exemplo n.º 4
0
 public ConfigurationException(IConfigurationResult result, string message, Exception innerException)
     : base(message, innerException)
 {
     Result = result;
 }
Exemplo n.º 5
0
 public ConfigurationException(IConfigurationResult result, string message)
     : base(message)
 {
     Result = result;
 }