public void Setup()
        {
            connection = Substitute.For <IReliableConnection>();
            model      = Substitute.For <IModelWithConnection>();
            connection.CreateModel().Returns(model);
            publishModule = Substitute.For <IPublishModule>();

            aggregator = new Aggregator();
            sut        = new QueueingPublishingProcess(Substitute.For <IIdGenerator>(),
                                                       Substitute.For <ISequenceGenerator>(),
                                                       Substitute.For <IExchangeResolver>(),
                                                       Substitute.For <IMessageSerializer>(),
                                                       Substitute.For <IMessageTypeResolver>(),
                                                       publishModule, aggregator);
            sut.Start();
        }
        public void Setup()
        {
            connection = Substitute.For<IReliableConnection>();
            model = Substitute.For<IModelWithConnection>();
            connection.CreateModel().Returns(model);
            publishModule = Substitute.For<IPublishModule>();

            aggregator = new Aggregator();
            sut = new QueueingPublishingProcess(Substitute.For<IIdGenerator>(),
                                                Substitute.For<ISequenceGenerator>(),
                                                Substitute.For<IExchangeResolver>(),
                                                Substitute.For<IMessageSerializer>(),
                                                Substitute.For<IMessageTypeResolver>(),
                                                publishModule, aggregator);
            sut.Start();
        }
Пример #3
0
        public void Setup()
        {
            connection = Substitute.For<IReliableConnection>();
            model = Substitute.For<IModelWithConnection>();
            connection.CreateModel().Returns(model);

            queueFactory = Substitute.For<IQueueFactory>();
            aggregator = new Aggregator();

            sut = new DefaultConsumingProcess(Substitute.For<IIdGenerator>(),
                                              Substitute.For<IExchangeResolver>(),
                                              Substitute.For<IMessageSerializer>(),
                                              Substitute.For<IMessageTypeResolver>(),
                                              Substitute.For<IConsumerContainer>(),
                                              Substitute.For<IMessageFilter>(),
                                              queueFactory,
                                              Substitute.For<IConsumerInvoker>(),
                                              new RogerOptions(), aggregator);
        }
Пример #4
0
        public void Setup()
        {
            connection = Substitute.For <IReliableConnection>();
            model      = Substitute.For <IModelWithConnection>();
            connection.CreateModel().Returns(model);

            queueFactory = Substitute.For <IQueueFactory>();
            aggregator   = new Aggregator();

            sut = new DefaultConsumingProcess(Substitute.For <IIdGenerator>(),
                                              Substitute.For <IExchangeResolver>(),
                                              Substitute.For <IMessageSerializer>(),
                                              Substitute.For <IMessageTypeResolver>(),
                                              Substitute.For <IConsumerContainer>(),
                                              Substitute.For <IMessageFilter>(),
                                              queueFactory,
                                              Substitute.For <IConsumerInvoker>(),
                                              new RogerOptions(), aggregator);
        }
Пример #5
0
        private void StartConsuming(IReliableConnection connection)
        {
            Model = connection.CreateModel();
            Model.ModelShutdown += ModelOnModelShutdown;

            if (options.PrefetchCount.HasValue)
            {
                log.InfoFormat("Setting QoS with prefetch count {0} on consuming channel", options.PrefetchCount);
                Model.BasicQos(0, options.PrefetchCount.Value, false);
            }

            Endpoint = new RogerEndpoint(Endpoint.IsEmpty ? queueFactory.Create(Model) : queueFactory.Create(Endpoint.Queue, Model));

            CreateBindings(new HashSet <Type>(consumerContainer.GetAllConsumerTypes().SelectMany(supportedMessageTypesResolver.Resolve)));
            log.DebugFormat("Declared and eventually bound endpoint {0}", Endpoint);

            aggregator.Notify(new ConsumingEnabled(Endpoint, connection));

            CreateConsumer();

            consumingTask = Task.Factory.StartNew(ConsumeSynchronously, TaskCreationOptions.LongRunning);
        }