Beispiel #1
0
            protected override void ConfigureRabbitMqReceiveEndpoint(IRabbitMqReceiveEndpointConfigurator configurator)
            {
                base.ConfigureRabbitMqReceiveEndpoint(configurator);

                _consumer = new MultiTestConsumer(TestTimeout);
                _consumer.Consume <B>();

                _consumer.Configure(configurator);
            }
            protected override void ConfigureInputQueueEndpoint(IRabbitMqReceiveEndpointConfigurator configurator)
            {
                base.ConfigureInputQueueEndpoint(configurator);

                configurator.UseConcurrencyLimit(1);

                _consumer = new MultiTestConsumer(TestTimeout);
                _consumer.Consume <B>();

                _consumer.Configure(configurator);
            }
Beispiel #3
0
        public async Task Should_deliver_the_message()
        {
            var multiConsumer = new MultiTestConsumer(TimeSpan.FromSeconds(8));
            var received      = multiConsumer.Consume <PingMessage>();

            var mediator = MassTransit.Bus.Factory.CreateMediator(cfg =>
            {
                multiConsumer.Configure(cfg);
            });

            await mediator.Send(new PingMessage());

            Assert.That(received.Select().Any(), Is.True);
        }
        public async Task Should_show_that_the_message_was_received_by_the_consumer()
        {
            var multiConsumer = new MultiTestConsumer(TestTimeout);
            ReceivedMessageList <PingMessage> received = multiConsumer.Consume <PingMessage>();

            var handle = Bus.ConnectReceiveEndpoint("boring2", x => multiConsumer.Configure(x));
            await handle.Ready;

            try
            {
                await Bus.Publish(new PingMessage());

                Assert.IsTrue(received.Select().Any());
            }
            finally
            {
                await handle.StopAsync();
            }
        }
Beispiel #5
0
        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            configurator.Handler <PingMessage>(async context =>
            {
            }, x =>
            {
                x.UseRateLimit(100, TimeSpan.FromSeconds(1));
                x.UseConcurrencyLimit(32);
            });

            _handled = Handled <PingMessage>(configurator);

            var consumer = new MultiTestConsumer(TestTimeout);

            consumer.Consume <PingMessage>();
            consumer.Consume <PongMessage>();

            consumer.Configure(configurator);
        }
        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            configurator.Handler<PingMessage>(async context =>
            {
            }, x =>
            {
                x.UseRateLimit(100, TimeSpan.FromSeconds(1));
                x.UseConcurrencyLimit(32);
            });

            _handled = Handled<PingMessage>(configurator);

            var consumer = new MultiTestConsumer(TestTimeout);

            consumer.Consume<PingMessage>();
            consumer.Consume<PongMessage>();

            consumer.Configure(configurator);
        }