Пример #1
0
 public static KafkaProducer <object, object, TValue> Create <TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TValue> valueSerializer)
 {
     return(new KafkaProducer <object, object, TValue>(brokers,
                                                       new NullSerializer <object>(),
                                                       valueSerializer,
                                                       new LoadBalancedPartitioner <object>()));
 }
Пример #2
0
 public static KafkaProducer <TKey, TPartitionKey, TValue> Create <TKey, TPartitionKey, TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TKey> keySerializer,
     IKafkaSerializer <TValue> valueSerializer,
     IKafkaMessagePartitioner <TPartitionKey> partitioner)
 {
     return(new KafkaProducer <TKey, TPartitionKey, TValue>(
                brokers,
                keySerializer,
                valueSerializer,
                partitioner));
 }
Пример #3
0
 public static KafkaProducer <TKey, TKey, TValue> Create <TKey, TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TKey> keySerializer,
     IKafkaSerializer <TValue> valueSerializer
     )
 {
     return(new KafkaProducer <TKey, TKey, TValue>(
                brokers,
                keySerializer,
                valueSerializer,
                new LoadBalancedPartitioner <TKey>()));
 }
Пример #4
0
 public static KafkaConsumer <TKey, TValue> Create <TKey, TValue>(string consumerGroup, KafkaBrokers brokers,
                                                                  IKafkaSerializer <TKey> keySerializer,
                                                                  IKafkaSerializer <TValue> valueSerializer, params TopicSelector[] topics)
 {
     return(new KafkaConsumer <TKey, TValue>(consumerGroup, brokers, keySerializer, valueSerializer, topics));
 }
Пример #5
0
 public static KafkaConsumer <object, TValue> Create <TValue>(string consumerGroup, KafkaBrokers brokers,
                                                              IKafkaSerializer <TValue> valueSerializer, params TopicSelector[] topics)
 {
     return(new KafkaConsumer <object, TValue>(consumerGroup, brokers, new NullSerializer <object>(), valueSerializer, topics));
 }