public when_building_an_envelope_for_sending_that_does_not_match_an_existing_channel()
        {
            theGraph = new ChannelGraph(theTransport, new StubTransport("fake"), new StubTransport("other"));
            theGraph.AcceptedContentTypes.Add("text/xml");
            theGraph.AcceptedContentTypes.Add("text/json");

            theSentEnvelope = theGraph.Send(theEnvelope, "stub://one".ToUri(), theSerializer);
        }
Exemple #2
0
        public string Send(Envelope envelope)
        {
            var channels = DetermineDestinationChannels(envelope).ToArray();

            if (!channels.Any())
            {
                throw new Exception($"No channels match this message ({envelope})");
            }

            foreach (var channel in channels)
            {
                var sent = _channels.Send(envelope, channel, _serializer);
                Logger.Sent(sent);
            }

            return(envelope.CorrelationId);
        }
        public when_building_an_envelope_for_sending_that_matches_an_existing_channel()
        {
            theGraph = new ChannelGraph(theTransport, new StubTransport("fake"), new StubTransport("other"));
            theGraph.AcceptedContentTypes.Add("text/xml");
            theGraph.AcceptedContentTypes.Add("text/json");



            var address = "stub://one".ToUri();



            theNode        = theGraph[address];
            theNode.Sender = new NulloSender(theTransport, theNode.Uri);
            theNode.ShouldNotBeNull();
            theNode.Destination = "remote://one".ToUri();
            theNode.ReplyUri    = "stub://replies".ToUri();

            theSentEnvelope = theGraph.Send(theEnvelope, address, theSerializer);
        }