public void registers_a_reply_queue_corrected_to_the_machine_name()
        {
            var uri = graph.ReplyChannelFor(LightningUri.Protocol);

            uri.ShouldNotBeNull();

            uri.Host.ToUpperInvariant().ShouldBe(Environment.MachineName.ToUpperInvariant());
        }
        public void registers_a_reply_queue_corrected_to_the_machine_name()
        {
            SetupTransport("lq.tcp://localhost:2032/upstream", ChannelMode.DeliveryGuaranteed);

            var uri = graph.ReplyChannelFor(LightningUri.Protocol);

            uri.ShouldNotBeNull();

            uri.Host.ToUpperInvariant().ShouldBe(Environment.MachineName.ToUpperInvariant());
        }
        public void FixtureSetup()
        {
            FubuTransport.AllQueuesInMemory = true;

            theRuntime = FubuTransport.For(x => { }).StructureMap(new Container()).Bootstrap();
            graph = theRuntime.Factory.Get<ChannelGraph>();

            var uri = graph.ReplyChannelFor(InMemoryChannel.Protocol);
            theReplyNode = graph.Single(x => x.Channel.Address == uri);
        }
        public void FixtureSetup()
        {
            FubuTransport.AllQueuesInMemory = true;

            theRuntime = FubuTransport.For(x => { }).StructureMap(new Container()).Bootstrap();
            graph      = theRuntime.Factory.Get <ChannelGraph>();

            var uri = graph.ReplyChannelFor(InMemoryChannel.Protocol);

            theReplyNode = graph.Single(x => x.Channel.Address == uri);
        }
Exemplo n.º 5
0
        public IEnumerable <Subscription> RemoveLocalSubscriptions()
        {
            var subscriptions = LoadSubscriptions(SubscriptionRole.Subscribes).ToList();

            if (!subscriptions.Any())
            {
                return(Enumerable.Empty <Subscription>());
            }

            var protocol           = subscriptions.First().Source.Scheme;
            var uri                = _graph.ReplyChannelFor(protocol);
            var localSubscriptions = subscriptions.Where(x => x.Receiver == uri).ToList();

            _persistence.DeleteSubscriptions(localSubscriptions);
            return(localSubscriptions);
        }
Exemplo n.º 6
0
        public void remove_local_subscriptions()
        {
            var subscriptions = new[] { ObjectMother.NewSubscription(), ObjectMother.NewSubscription() };

            subscriptions.Each(x =>
            {
                x.Receiver = channelGraph.ReplyChannelFor("foo");
                x.Source   = new Uri("foo://source");
            });

            theRepository.PersistSubscriptions(subscriptions);
            persistence.LoadSubscriptions(TheNodeName, SubscriptionRole.Subscribes)
            .ShouldHaveTheSameElementsAs(subscriptions);

            var removed = theRepository.RemoveLocalSubscriptions();

            removed.ShouldHaveTheSameElementsAs(subscriptions);

            persistence.LoadSubscriptions(TheNodeName, SubscriptionRole.Subscribes)
            .ShouldHaveCount(0);
        }
        public IEnumerable <Subscription> Determine(T settings, ChannelGraph graph)
        {
            var source = _accessor.GetValue(settings).As <Uri>();

            if (source == null)
            {
                throw new InvalidOperationException("No Uri established for {0}.{1}".ToFormat(typeof(T).Name, _accessor.Name));
            }

            var receiver = graph.ReplyChannelFor(source.Scheme);

            foreach (var messageType in _messageTypes)
            {
                yield return(new Subscription(messageType)
                {
                    NodeName = graph.Name,
                    Receiver = receiver,
                    Source = source
                });
            }
        }
Exemplo n.º 8
0
 public Uri ReplyUriFor(ChannelNode destination)
 {
     return(_graph.ReplyChannelFor(destination.Protocol()));
 }