public static bool TryToRoute(PublishedMessage sender, Subscription receiver, out MessageRoute route, out PublisherSubscriberMismatch mismatch) { route = null; mismatch = null; var transportsMatch = (sender.Transports ?? new string[0]).Contains(receiver.Destination.Scheme); var contentType = SelectContentType(sender, receiver); if (transportsMatch && contentType.IsNotEmpty()) { route = new MessageRoute(sender.DotNetType, receiver.Destination, contentType) { Publisher = sender.ServiceName, Receiver = receiver.ServiceName }; return(true); } mismatch = new PublisherSubscriberMismatch(sender, receiver) { IncompatibleTransports = !transportsMatch, IncompatibleContentTypes = contentType == null }; return(false); }
public void ForMismatch([SelectionList("MessageTypes")] string messageType, string publisher, string subscriber) { _mismatch = _graph.Mismatches.FirstOrDefault(x => x.MessageType == messageType && x.Publisher == publisher && x.Subscriber == subscriber); StoryTellerAssert.Fail(_mismatch == null, () => $@"Could not find this mismatch, the known mismatches are: {_graph.Mismatches.Select(x => $"* {x}{Environment.NewLine}")} "); }
public void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { foreach (var sink in Loggers) { try { sink.SubscriptionMismatch(mismatch); } catch (Exception) { } } }
public void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { }
public void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { ConsoleWriter.Write(ConsoleColor.Yellow, $"Subscriber mismatch: {mismatch}"); }
public virtual void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { _subscriptionMismatch(_logger, mismatch, null); }
public void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { trace($"Subscription mismatch: {mismatch}"); }
public override void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { _mismatches.Add(mismatch); base.SubscriptionMismatch(mismatch); }
public void SubscriptionMismatch(PublisherSubscriberMismatch mismatch) { _mismatches.Add(mismatch); }