Exemplo n.º 1
0
        public void InitializeBus()
        {
            consumerContainer = new SimpleConsumerContainer();

            Bus = new RogerBus(ConnectionFactory,
                               consumerContainer,
                               idGenerator: IdGenerator,
                               sequenceGenerator: SequenceGenerator,
                               options: new RogerOptions(prefetchCount: null /*no safety nets during tests*/));

            Bus.Filters.Add(MessageFilters.ToArray());

            localConnection = Helpers.CreateConnection();
            TestModel = localConnection.CreateModel();
            TestModel.ExchangeDeclare("TestExchange",
                                      ExchangeType.Topic,
                                      true /* to have the exchange there when restarting broker app within tests */,
                                      false,
                                      null);

            BeforeBusInitialization();

            Bus.Start();

            AfterBusInitialization();
        }
Exemplo n.º 2
0
        protected override void AfterBusInitialization()
        {
            secondaryConsumerContainer = new SimpleConsumerContainer();

            BeforeSecondaryBusInitialization();

            SecondaryBus = new RogerBus(new ManualConnectionFactory(Helpers.CreateConnectionOnAlternativePort),
                                        secondaryConsumerContainer, options: new RogerOptions(prefetchCount: null));

            SecondaryBus.Start();

            AfterSecondaryBusInitialization();
        }