/// <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)); }
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)); }
/// <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)); }
/// <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)); }
/// <summary> /// Publish matching messages to Pulsar 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 DotPulsarSubscriberConfiguration ToPulsarTopic(this IPublishToExpression publishing, string topicName) => ToPulsarTopic(publishing, new ProducerOptions(topicName));
/// <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)); }