コード例 #1
0
        public IList <Peer> GetPeers(BindingKey routingKey)
        {
            var peerCollector = new PeerCollector(_peersMatchingAllMessages);

            _rootNode.Accept(peerCollector, routingKey);

            return(peerCollector.GetPeers());
        }
コード例 #2
0
        public IList<Peer> GetPeers(BindingKey routingKey)
        {
            var peerCollector = new PeerCollector(_peersMatchingAllMessages);

            _rootNode.Accept(peerCollector, routingKey);

            return peerCollector.GetPeers();
        }
コード例 #3
0
        public IList <Peer> GetPeers(BindingKey routingKey)
        {
            var peerCollector = new PeerCollector(_peersMatchingAllMessages);

            if (routingKey.IsEmpty)
            {
                // The message is not routable or has no routing member.

                // If the tree contains any subscription with a binding key, it indicates a message definition
                // mismatch between the publisher and the subscriber. In this situation, it is safer to send
                // the message to the subscriber anyway.

                // => Always forward the message to all peers.

                _rootNode.AddAllPeers(peerCollector);
            }
            else
            {
                _rootNode.Accept(peerCollector, routingKey);
            }

            return(peerCollector.GetPeers());
        }