Exemplo n.º 1
0
        public void Configure(Configure config)
        {
            Builder    = config.Builder;
            Configurer = config.Configurer;

            NcqrsEnvironment.Configure(new NsbEnvironmentConfiguration(Builder));
            var compositeBus = new CompositeEventBus();

            _inProcessEventBus = new InProcessEventBus(false);
            compositeBus.AddBus(new NsbEventBus());
            compositeBus.AddBus(_inProcessEventBus);
            NcqrsEnvironment.SetDefault <IEventBus>(compositeBus);
            _commandService = new NsbCommandService();
            config.Configurer.RegisterSingleton(typeof(ICommandService),
                                                _commandService);
        }
Exemplo n.º 2
0
        public void Configure(Configure config)
        {
            Builder    = config.Builder;
            Configurer = config.Configurer;

            NcqrsEnvironment.Configure(new NsbEnvironmentConfiguration(Builder));
            var compositeBus = new CompositeEventBus();

            _inProcessEventBus = new InProcessEventBus(false);
            compositeBus.AddBus(new NsbEventBus());
            compositeBus.AddBus(_inProcessEventBus);
            _sendingEventHandler = new MessageSendingEventHandler();
            _inProcessEventBus.RegisterHandler(_sendingEventHandler);
            NcqrsEnvironment.SetDefault(compositeBus);
            _messageService = new MessageService();
            config.Configurer.RegisterSingleton(typeof(IMessageService), _messageService);
        }