瀏覽代碼

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

Co-authored-by: Unknown <email@example.co.uk>
master
Dan 3 年之前
committed by GitHub
父節點
當前提交
42796c95b5
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs

+ 3
- 3
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs 查看文件

@@ -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();
}


Loading…
取消
儲存