public static async Task <IGroupConsumer> CreateGroupConsumerAsync(this KafkaOptions options, string groupId, ConsumerProtocolMetadata metadata, CancellationToken cancellationToken) { var router = await options.CreateRouterAsync(); var response = await router.JoinGroupAsync(groupId, ConsumerEncoder.Protocol, new [] { metadata }, options.ConsumerConfiguration, cancellationToken); return(new GroupConsumer(router, groupId, ConsumerEncoder.Protocol, response, options.ConsumerConfiguration, options.Encoders, false)); }
public static async Task <IProducer> CreateProducerAsync(this KafkaOptions options) { return(new Producer(await options.CreateRouterAsync(), options.ProducerConfiguration, false)); }
public static async Task <IConsumer> CreateConsumerAsync(this KafkaOptions options, string topicName, int partitionId) { return(new Consumer(topicName, partitionId, await options.CreateRouterAsync(), options.ConsumerConfiguration, false)); }