Example #1
0
        /// <summary>
        /// Publish matching messages to Rabbit MQ to the designated exchange by the topic name for the message
        /// type or the designated topic name in the Envelope. This is *only* usable
        /// for "topic" exchanges
        /// </summary>
        /// <param name="publishing"></param>
        /// <param name="exchangeName">The Rabbit MQ exchange name</param>
        /// <returns></returns>
        public static TopicRouterConfiguration <RabbitMqSubscriberConfiguration> ToRabbitTopics(this IPublishToExpression publishing, string exchangeName)
        {
            var transports = publishing.As <PublishingExpression>().Parent;

            var router = new RabbitMqTopicRouter(exchangeName);

            publishing.ViaRouter(router);

            return(new TopicRouterConfiguration <RabbitMqSubscriberConfiguration>(router, transports));
        }
        /// <summary>
        /// Publish matching messages to Azure Service Bus using the topic name derived from the message and
        /// </summary>
        /// <param name="publishing"></param>
        /// <returns></returns>
        public static TopicRouterConfiguration <AzureServiceBusSubscriberConfiguration> ToAzureServiceBusTopics(this IPublishToExpression publishing)
        {
            var transports = publishing.As <PublishingExpression>().Parent;

            var router = transports.AsbTransport().Topics;

            publishing.ViaRouter(router);

            return(new TopicRouterConfiguration <AzureServiceBusSubscriberConfiguration>(router, transports));
        }