-
Notifications
You must be signed in to change notification settings - Fork 36
/
IConfluentProducerBuilder.cs
56 lines (51 loc) · 2.08 KB
/
IConfluentProducerBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) 2020 Sergio Aquilini
// This code is licensed under MIT license (see LICENSE file for details)
using System;
using Confluent.Kafka;
namespace Silverback.Messaging.Broker.Kafka
{
/// <summary>
/// The <see cref="IProducer{TKey,TValue}" /> builder used by the <see cref="KafkaProducer" />.
/// </summary>
public interface IConfluentProducerBuilder
{
/// <summary>
/// Sets the producer configuration.
/// </summary>
/// <param name="config">
/// The configuration.
/// </param>
/// <returns>
/// The <see cref="IConfluentProducerBuilder" /> so that additional calls can be chained.
/// </returns>
IConfluentProducerBuilder SetConfig(ProducerConfig config);
/// <summary>
/// Sets the handler to call on statistics events.
/// </summary>
/// <param name="statisticsHandler">
/// The event handler.
/// </param>
/// <returns>
/// The <see cref="IConfluentProducerBuilder" /> so that additional calls can be chained.
/// </returns>
IConfluentProducerBuilder SetStatisticsHandler(Action<IProducer<byte[]?, byte[]?>, string> statisticsHandler);
/// <summary>
/// Set the handler to call when there is information available to be logged. If not specified, a default
/// callback that writes to stderr will be used.
/// </summary>
/// <param name="logHandler">
/// The event handler.
/// </param>
/// <returns>
/// The <see cref="IConfluentProducerBuilder" /> so that additional calls can be chained.
/// </returns>
public IConfluentProducerBuilder SetLogHandler(Action<IProducer<byte[]?, byte[]?>, LogMessage> logHandler);
/// <summary>
/// Builds the <see cref="IProducer{TKey,TValue}" /> instance.
/// </summary>
/// <returns>
/// The <see cref="IProducer{TKey,TValue}" />.
/// </returns>
IProducer<byte[]?, byte[]?> Build();
}
}