Table of Contents

Class ConfluentProducerBuilder

Namespace
Silverback.Messaging.Broker.Kafka
Assembly
Silverback.Integration.Kafka.dll

Wraps the Confluent.Kafka.ProducerBuilder<TKey, TValue>.

public class ConfluentProducerBuilder : IConfluentProducerBuilder
Inheritance
ConfluentProducerBuilder
Implements
Inherited Members

Constructors

ConfluentProducerBuilder()

public ConfluentProducerBuilder()

Methods

Build()

Builds the Confluent.Kafka.IProducer<TKey, TValue> instance.

public IProducer<byte[]?, byte[]?> Build()

Returns

IProducer<byte[], byte[]>

The Confluent.Kafka.IProducer<TKey, TValue>.

SetConfiguration(ProducerConfig)

Sets the producer configuration.

public IConfluentProducerBuilder SetConfiguration(ProducerConfig config)

Parameters

config ProducerConfig

The configuration.

Returns

IConfluentProducerBuilder

The IConfluentProducerBuilder so that additional calls can be chained.

SetErrorHandler(Action<IProducer<byte[]?, byte[]?>, Error>)

Sets the handler to call on error events.

public IConfluentProducerBuilder SetErrorHandler(Action<IProducer<byte[]?, byte[]?>, Error> errorHandler)

Parameters

errorHandler Action<IProducer<byte[], byte[]>, Error>

The event handler.

Returns

IConfluentProducerBuilder

The IConfluentProducerBuilder so that additional calls can be chained.

SetLogHandler(Action<IProducer<byte[]?, byte[]?>, LogMessage>)

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.

public IConfluentProducerBuilder SetLogHandler(Action<IProducer<byte[]?, byte[]?>, LogMessage> logHandler)

Parameters

logHandler Action<IProducer<byte[], byte[]>, LogMessage>

The event handler.

Returns

IConfluentProducerBuilder

The IConfluentProducerBuilder so that additional calls can be chained.

SetStatisticsHandler(Action<IProducer<byte[]?, byte[]?>, string>)

Sets the handler to call on statistics events.

public IConfluentProducerBuilder SetStatisticsHandler(Action<IProducer<byte[]?, byte[]?>, string> statisticsHandler)

Parameters

statisticsHandler Action<IProducer<byte[], byte[]>, string>

The event handler.

Returns

IConfluentProducerBuilder

The IConfluentProducerBuilder so that additional calls can be chained.