protected override Uri getReplyUri(ChannelGraph graph) { var channelNode = graph.FirstOrDefault(x => x.Protocol() == LightningUri.Protocol && x.Incoming && x.Mode == ChannelMode.DeliveryGuaranteed) ?? graph.FirstOrDefault(x => x.Protocol() == LightningUri.Protocol && x.Incoming && x.Mode == ChannelMode.DeliveryFastWithoutGuarantee); if (channelNode == null) { throw new InvalidOperationException("You must have at least one incoming Lightning Queue channel for accepting replies"); } return(channelNode.Channel.Address.ToLocalUri()); }
protected override Uri getReplyUri(ChannelGraph graph) { var channelNode = graph.FirstOrDefault(x => x.Protocol() == LightningUri.Protocol && x.Incoming); if (channelNode == null) throw new InvalidOperationException("You must have at least one incoming Lightning Queue channel for accepting replies"); return channelNode.Channel.Address.ToLocalUri(); }
/// <summary> /// Sends a message from this node to the system under test. /// </summary> public void Send <T>(T message) { var channelNode = _systemUnderTest.FirstOrDefault(x => x.Publishes(typeof(T))); if (channelNode == null) { throw new ArgumentException("Cannot find destination channel for message type {0}. Have you configured the channel with AcceptsMessage()?".ToFormat(typeof(T)), "message"); } Uri destination = channelNode.Uri; var bus = Runtime.Get <IServiceBus>(); bus.Send(destination, message); }
private ChannelNode findDestination(Uri uri) { return(_graph.FirstOrDefault(x => x.Uri == uri) ?? _volatileNodes[uri]); }