Esempio n. 1
0
        /// <summary>
        /// Listen for incoming messages at the designated Kafka Topic by name
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <typeparam name="TVal"></typeparam>
        /// <param name="endpoints"></param>
        /// <param name="topicName"></param>
        /// <param name="consumerConfig"></param>
        /// <returns></returns>
        public static KafkaListenerConfiguration ListenToKafkaTopic(this IEndpoints endpoints, string topicName, ConsumerConfig consumerConfig)
        {
            var endpoint = endpoints.KafkaTransport().EndpointForTopic(topicName, consumerConfig);

            endpoint.IsListener = true;
            return(new KafkaListenerConfiguration(endpoint));
        }
Esempio n. 2
0
        /// <summary>
        /// Configure connection and authentication information about the Azure Service Bus usage
        /// within this Jasper application
        /// </summary>
        /// <param name="endpoints"></param>
        /// <param name="configure"></param>
        public static void ConfigureKafka(this IEndpoints endpoints, Action <KafkaTransport> configure)
        {
            var transport = endpoints.KafkaTransport();

            endpoints.As <TransportCollection>().Subscribers.Fill(transport.Topics);
            configure(transport);
        }