public IReceivePipeDispatcher Build()
        {
            var result = BusConfigurationResult.CompileResults(Validate());

            try
            {
                var builder = new ReceiveEndpointBuilder(_endpointConfiguration);

                foreach (var specification in Specifications)
                {
                    specification.Configure(builder);
                }

                return(new ReceivePipeDispatcher(_endpointConfiguration.CreateReceivePipe(), _endpointConfiguration.ReceiveObservers, _hostConfiguration));
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception occurred during mediator creation", ex);
            }
        }
示例#2
0
        public IReceivePipeDispatcher Build()
        {
            var result = BusConfigurationResult.CompileResults(Validate());

            try
            {
                var builder = new ReceiveEndpointBuilder(_endpointConfiguration);

                foreach (var specification in Specifications)
                {
                    specification.Configure(builder);
                }

                var logContext = LogContext.Current.CreateLogContext(LogCategoryName.Transport.Receive);

                return(new ReceivePipeDispatcher(_endpointConfiguration.CreateReceivePipe(), _endpointConfiguration.ReceiveObservers, logContext));
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception occurred during handler creation", ex);
            }
        }