Sfoglia il codice sorgente

Change Kafka BuildConsumer to return Consumer rather than set private _consumerClient (#990)

Co-authored-by: Unknown <email@example.co.uk>
master
Dan 3 anni fa
committed by GitHub
parent
commit
42796c95b5
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. +3
    -3
      src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs

+ 3
- 3
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs Vedi File

@@ -153,7 +153,7 @@ namespace DotNetCore.CAP.Kafka
config.EnableAutoCommit ??= false;
config.LogConnectionClose ??= false;

BuildConsumer(config);
_consumerClient = BuildConsumer(config);
}
}
finally
@@ -162,9 +162,9 @@ namespace DotNetCore.CAP.Kafka
}
}

protected virtual void BuildConsumer(ConsumerConfig config)
protected virtual IConsumer<string, byte[]> BuildConsumer(ConsumerConfig config)
{
_consumerClient = new ConsumerBuilder<string, byte[]>(config)
return new ConsumerBuilder<string, byte[]>(config)
.SetErrorHandler(ConsumerClient_OnConsumeError)
.Build();
}


Caricamento…
Annulla
Salva