public void SetupApi()
        {
            query         = ConfigurationHelpers.RabbitMqQueryWithConfigSettings();
            channelAction = ConfigurationHelpers.ChannelWithAppConfigSettings();
            var shortTermConnection = ConfigurationHelpers.FreshConnectionFromAppConfig();

            router = new RabbitRouter(channelAction, shortTermConnection);
        }
        public void SetUp()
        {
            var longTermConnection  = ConfigurationHelpers.ChannelWithAppConfigSettings();
            var shortTermConnection = ConfigurationHelpers.FreshConnectionFromAppConfig();

            router  = new RabbitRouter(longTermConnection, shortTermConnection);
            subject = new TypeRouter(router);
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            var longTermConnection  = ConfigurationHelpers.ChannelWithAppConfigSettings();
            var shortTermConnection = ConfigurationHelpers.FreshConnectionFromAppConfig();

            subject = new RabbitRouter(longTermConnection, shortTermConnection);

            typeRouter = new TypeRouter(subject);
            typeRouter.BuildRoutes(typeof(IFile));

            subject.AddDestination("dst");
            subject.Link("Example.Types.IMsg", "dst");
            subject.Send("Example.Types.IFile", null, null, null, "Hello");
        }
        public void Can_pick_up_a_message_from_a_different_connection_after_its_acknowledged_but_not_received()
        {
            router.AddSource("src", null);
            router.AddDestination("dst");
            router.Link("src", "dst");
            router.Send("src", null, null, null, "Hello, World");

            channelAction.WithChannel(channel => channel.BasicAck(0, true));

            var conn = ConfigurationHelpers.FreshConnectionFromAppConfig();

            var conn2    = conn.ConfigureConnectionFactory().CreateConnection();
            var channel2 = conn2.CreateModel();
            var result   = channel2.BasicGet("dst", false);
            var message  = Encoding.UTF8.GetString(result.Body);

            Assert.That(message, Is.EqualTo("Hello, World"));
        }