Skip to content

Commit 52640f7

Browse files
AndyPookmhowlett
authored andcommitted
use IConsumer/IProducer (#878)
1 parent c6ac70a commit 52640f7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Confluent.Kafka/ConsumerBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ public class ConsumerBuilder<TKey, TValue>
3939
/// <summary>
4040
/// The configured error handler.
4141
/// </summary>
42-
internal protected Action<Consumer<TKey, TValue>, Error> ErrorHandler { get; set; }
42+
internal protected Action<IConsumer<TKey, TValue>, Error> ErrorHandler { get; set; }
4343

4444
/// <summary>
4545
/// The configured log handler.
4646
/// </summary>
47-
internal protected Action<Consumer<TKey, TValue>, LogMessage> LogHandler { get; set; }
47+
internal protected Action<IConsumer<TKey, TValue>, LogMessage> LogHandler { get; set; }
4848

4949
/// <summary>
5050
/// The configured statistics handler.
5151
/// </summary>
52-
internal protected Action<Consumer<TKey, TValue>, string> StatisticsHandler { get; set; }
52+
internal protected Action<IConsumer<TKey, TValue>, string> StatisticsHandler { get; set; }
5353

5454
/// <summary>
5555
/// The configured key deserializer.
@@ -141,7 +141,7 @@ public ConsumerBuilder(IEnumerable<KeyValuePair<string, string>> config)
141141
/// Executes as a side-effect of the Consume method (on the same thread).
142142
/// </remarks>
143143
public ConsumerBuilder<TKey, TValue> SetStatisticsHandler(
144-
Action<Consumer<TKey, TValue>, string> statisticsHandler)
144+
Action<IConsumer<TKey, TValue>, string> statisticsHandler)
145145
{
146146
if (this.StatisticsHandler != null)
147147
{
@@ -161,7 +161,7 @@ public ConsumerBuilder<TKey, TValue> SetStatisticsHandler(
161161
/// Executes as a side-effect of the Consume method (on the same thread).
162162
/// </remarks>
163163
public ConsumerBuilder<TKey, TValue> SetErrorHandler(
164-
Action<Consumer<TKey, TValue>, Error> errorHandler)
164+
Action<IConsumer<TKey, TValue>, Error> errorHandler)
165165
{
166166
if (this.ErrorHandler != null)
167167
{
@@ -188,7 +188,7 @@ public ConsumerBuilder<TKey, TValue> SetErrorHandler(
188188
/// prolonged operations.
189189
/// </remarks>
190190
public ConsumerBuilder<TKey, TValue> SetLogHandler(
191-
Action<Consumer<TKey, TValue>, LogMessage> logHandler)
191+
Action<IConsumer<TKey, TValue>, LogMessage> logHandler)
192192
{
193193
if (this.LogHandler != null)
194194
{

src/Confluent.Kafka/ProducerBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ public class ProducerBuilder<TKey, TValue>
3333
/// <summary>
3434
/// The configured error handler.
3535
/// </summary>
36-
internal protected Action<Producer<TKey, TValue>, Error> ErrorHandler { get; set; }
36+
internal protected Action<IProducer<TKey, TValue>, Error> ErrorHandler { get; set; }
3737

3838
/// <summary>
3939
/// The configured log handler.
4040
/// </summary>
41-
internal protected Action<Producer<TKey, TValue>, LogMessage> LogHandler { get; set; }
41+
internal protected Action<IProducer<TKey, TValue>, LogMessage> LogHandler { get; set; }
4242

4343
/// <summary>
4444
/// The configured statistics handler.
4545
/// </summary>
46-
internal protected Action<Producer<TKey, TValue>, string> StatisticsHandler { get; set; }
46+
internal protected Action<IProducer<TKey, TValue>, string> StatisticsHandler { get; set; }
4747

4848

4949
/// <summary>
@@ -108,7 +108,7 @@ public ProducerBuilder(IEnumerable<KeyValuePair<string, string>> config)
108108
/// Executes on the poll thread (by default, a background thread managed by
109109
/// the producer).
110110
/// </remarks>
111-
public ProducerBuilder<TKey, TValue> SetStatisticsHandler(Action<Producer<TKey, TValue>, string> statisticsHandler)
111+
public ProducerBuilder<TKey, TValue> SetStatisticsHandler(Action<IProducer<TKey, TValue>, string> statisticsHandler)
112112
{
113113
if (this.StatisticsHandler != null)
114114
{
@@ -128,7 +128,7 @@ public ProducerBuilder<TKey, TValue> SetStatisticsHandler(Action<Producer<TKey,
128128
/// Executes on the poll thread (by default, a background thread managed by
129129
/// the producer).
130130
/// </remarks>
131-
public ProducerBuilder<TKey, TValue> SetErrorHandler(Action<Producer<TKey, TValue>, Error> errorHandler)
131+
public ProducerBuilder<TKey, TValue> SetErrorHandler(Action<IProducer<TKey, TValue>, Error> errorHandler)
132132
{
133133
if (this.ErrorHandler != null)
134134
{
@@ -154,7 +154,7 @@ public ProducerBuilder<TKey, TValue> SetErrorHandler(Action<Producer<TKey, TValu
154154
/// Confluent.Kafka APIs from within a log handler or perform any
155155
/// prolonged operations.
156156
/// </remarks>
157-
public ProducerBuilder<TKey, TValue> SetLogHandler(Action<Producer<TKey, TValue>, LogMessage> logHandler)
157+
public ProducerBuilder<TKey, TValue> SetLogHandler(Action<IProducer<TKey, TValue>, LogMessage> logHandler)
158158
{
159159
if (this.LogHandler != null)
160160
{

0 commit comments

Comments
 (0)