示例#1
0
        public IBusControl Build()
        {
            try
            {
                PreBuild();

                var bus = new MassTransitBus(InputAddress, ConsumePipe, SendEndpointProvider, PublishEndpointProvider, _hosts, BusObservable);

                TaskUtil.Await(() => _busObservable.PostCreate(bus));

                return(bus);
            }
            catch (Exception exception)
            {
                TaskUtil.Await(() => BusObservable.CreateFaulted(exception));

                throw;
            }
        }
示例#2
0
        public IBusControl Build()
        {
            try
            {
                _busEndpointSpecification.Apply(this);

                var bus = new MassTransitBus(_busEndpointConfiguration.InputAddress, _busEndpointConfiguration.ConsumePipe, _busEndpointSpecification.SendEndpointProvider,
                                             _busEndpointSpecification.PublishEndpointProvider, _configuration.Hosts, _busObservable);

                TaskUtil.Await(() => _busObservable.PostCreate(bus));

                return(bus);
            }
            catch (Exception exception)
            {
                TaskUtil.Await(() => _busObservable.CreateFaulted(exception));

                throw;
            }
        }