/// <summary> /// Creates an instance of the ServiceBus, which implements IServiceBus. This is normally /// not called and should be created using the ServiceBusConfigurator to ensure proper defaults /// and operation. /// </summary> public ServiceBus(IEndpoint endpointToListenOn, IObjectBuilder objectBuilder, IEndpointFactory endpointFactory) { ReceiveTimeout = TimeSpan.FromSeconds(3); endpointToListenOn.MustNotBeNull("endpointToListenOn", "This parameter cannot be null"); objectBuilder.MustNotBeNull("objectBuilder", "This parameter cannot be null"); endpointFactory.MustNotBeNull("endpointFactory", "This parameter cannot be null"); Endpoint = endpointToListenOn; ObjectBuilder = objectBuilder; EndpointFactory = endpointFactory; _eventAggregator = PipeSegment.New(); _eventAggregatorScope = _eventAggregator.NewSubscriptionScope(); _serviceContainer = new ServiceContainer(this); OutboundPipeline = MessagePipelineConfigurator.CreateDefault(ObjectBuilder, this); InboundPipeline = MessagePipelineConfigurator.CreateDefault(ObjectBuilder, this); InboundPipeline.Configure(x => { _unsubscribeEventDispatchers += x.Register(new InboundOutboundSubscriptionBinder(OutboundPipeline, Endpoint)); }); PoisonEndpoint = new PoisonEndpointDecorator(new NullEndpoint()); ControlBus = this; InitializePerformanceCounters(); }
public UnsubscribeAction Configure(Func <IInboundPipelineConfigurator, UnsubscribeAction> configure) { return(InboundPipeline.Configure(configure)); }