public static DotPulsarSubscriberConfiguration ToPulsarTopic(this IPublishToExpression publishing, ProducerOptions producerOptions)
        {
            var transports = publishing.As <PublishingExpression>().Parent;
            var transport  = transports.Get <DotPulsarTransport>();
            var endpoint   = transport.EndpointFor(producerOptions);

            // This is necessary unfortunately to hook up the subscription rules
            publishing.To(endpoint.Uri);

            return(new DotPulsarSubscriberConfiguration(endpoint));
        }
Beispiel #2
0
        /// <summary>
        /// Publish matching messages to Rabbit MQ to the designated exchange. This is
        /// appropriate for "fanout" exchanges where Rabbit MQ ignores the routing key
        /// </summary>
        /// <param name="publishing"></param>
        /// <param name="exchangeName">The Rabbit MQ exchange name</param>
        /// <returns></returns>
        public static RabbitMqSubscriberConfiguration ToRabbitExchange(this IPublishToExpression publishing, string exchangeName)
        {
            var transports = publishing.As <PublishingExpression>().Parent;
            var transport  = transports.Get <RabbitMqTransport>();
            var endpoint   = transport.EndpointForExchange(exchangeName);

            // This is necessary unfortunately to hook up the subscription rules
            publishing.To(endpoint.Uri);

            return(new RabbitMqSubscriberConfiguration(endpoint));
        }
Beispiel #3
0
        /// <summary>
        /// Publish matching messages to Kafka Topic using provided Producer Configuration
        /// </summary>
        /// <param name="publishing"></param>
        /// <param name="topicName">This is used as the topic name when publishing. Can be either a binding key or a queue name or a static topic name if the exchange is topic-based</param>
        /// <param name="exchangeName">Optional, you only need to supply this if you are using a non-default exchange</param>
        /// <returns></returns>
        public static KafkaSubscriberConfiguration ToKafkaTopic(this IPublishToExpression publishing, string topicName, ProducerConfig producerConfig)
        {
            var transports = publishing.As <PublishingExpression>().Parent;
            var transport  = transports.Get <KafkaTransport>();
            var endpoint   = transport.EndpointForTopic(topicName, producerConfig);

            // This is necessary unfortunately to hook up the subscription rules
            publishing.To(endpoint.Uri);

            return(new KafkaSubscriberConfiguration(endpoint));
        }
        /// <summary>
        /// Publish matching messages to Rabbit MQ using the named routing key or queue name and
        /// optionally an exchange
        /// </summary>
        /// <param name="publishing"></param>
        /// <param name="routingKeyOrQueue">This is used as the routing key when publishing. Can be either a binding key or a queue name or a static topic name if the exchange is topic-based</param>
        /// <param name="exchangeName">Optional, you only need to supply this if you are using a non-default exchange</param>
        /// <returns></returns>
        public static AzureServiceBusSubscriberConfiguration ToAzureServiceBusQueue(this IPublishToExpression publishing, string queueName)
        {
            var transports = publishing.As <PublishingExpression>().Parent;
            var transport  = transports.Get <AzureServiceBusTransport>();
            var endpoint   = transport.EndpointForQueue(queueName);

            // This is necessary unfortunately to hook up the subscription rules
            publishing.To(endpoint.Uri);

            return(new AzureServiceBusSubscriberConfiguration(endpoint));
        }