Example #1
0
        public async Task can_route_non_transactional_to_other_queue()
        {
            using (var router = new NonTransactionalRouter(inputQueueFormatName, sender, msg => msg.Label.Contains("1") ? outSend1 : outSend2))
            {
                await sender.StartAsync();

                try
                {
                    var rtask = router.StartAsync();
                    input.Write(new Message {
                        Label = "2", AppSpecific = 1
                    });
                    var got = outRead2.Read();
                    Assert.AreEqual("2", got.Label);
                }
                finally
                {
                    await router?.StopAsync();

                    await sender.StopAsync();
                }
            }
        }
Example #2
0
        public async Task can_route_non_transactional_to_deadletter()
        {
            using (var router = new NonTransactionalRouter(inputQueueFormatName, sender, msg => null))
            {
                await sender.StartAsync();

                try
                {
                    var rtask = router.StartAsync();
                    input.Write(new Message {
                        Label = "3", AppSpecific = 1
                    });
                    var got = dead.Read();
                    Assert.AreEqual("3", got.Label);
                }
                finally
                {
                    await router?.StopAsync();

                    await sender.StopAsync();
                }
            }
        }