void FindOrAddEndpoint(Type messageType, IRabbitMqEndpointAddress address)
        {
            var locator = new PublishEndpointSinkLocator(messageType, address);

            _bus.OutboundPipeline.Inspect(locator);

            if (locator.Found)
            {
                _added.Add(messageType, () => true);
                return;
            }

            IEndpoint endpoint = _bus.GetEndpoint(address.Uri);

            this.FastInvoke(new[] { messageType }, "CreateEndpointSink", endpoint);
        }
Пример #2
0
        /// <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, IRabbitMqEndpointAddress address)
        {
            var locator = new PublishEndpointSinkLocator(messageType, address);

            _bus.OutboundPipeline.Inspect(locator);

            if (locator.Found) // there was already a subscribed endpoint
            {
                _added.Add(messageType, () => true);
                return;
            }

            IEndpoint endpoint = _bus.GetEndpoint(address.Uri);

            // otherwise, create the sink for this message type and connect the out
            // bound pipeline to this sink.
            this.FastInvoke(new[] { messageType }, "CreateEndpointSink", endpoint);
        }