/// <summary> /// Finds all endpoints in the outbound pipeline and starts routing messages /// to that endpoint. /// </summary> /// <param name="messageType">type of message</param> /// <param name="address">The message endpoint address.</param> void FindOrAddEndpoint(Type messageType, IAzureServiceBusEndpointAddress address) { var locator = new PublishEndpointSinkLocator(messageType, address); _bus.OutboundPipeline.Inspect(locator); if (locator.Found) { _added.Add(messageType, () => true); // subscribed sink exists already, returning return; } // otherwise, get the endpoint and add a sink for it IEndpoint endpoint = _bus.GetEndpoint(address.Uri); this.FastInvoke(new[] { messageType }, "CreateEndpointSink", endpoint); }