Table of Contents

Interface IConfluentConsumerBuilder

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

The Confluent.Kafka.IConsumer<TKey, TValue> builder used by the KafkaConsumer.

public interface IConfluentConsumerBuilder

Methods

Build()

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

IConsumer<byte[]?, byte[]?> Build()

Returns

IConsumer<byte[], byte[]>

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

SetConfig(ConsumerConfig)

Sets the consumer configuration.

IConfluentConsumerBuilder SetConfig(ConsumerConfig config)

Parameters

config ConsumerConfig

The configuration.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

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

Sets the handler to call on error events.

IConfluentConsumerBuilder SetErrorHandler(Action<IConsumer<byte[]?, byte[]?>, Error> errorHandler)

Parameters

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

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetLogHandler(Action<IConsumer<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.

IConfluentConsumerBuilder SetLogHandler(Action<IConsumer<byte[]?, byte[]?>, LogMessage> logHandler)

Parameters

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

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetOffsetsCommittedHandler(Action<IConsumer<byte[]?, byte[]?>, CommittedOffsets>)

Sets the handler to call on offsets committed events.

IConfluentConsumerBuilder SetOffsetsCommittedHandler(Action<IConsumer<byte[]?, byte[]?>, CommittedOffsets> offsetsCommittedHandler)

Parameters

offsetsCommittedHandler Action<IConsumer<byte[], byte[]>, CommittedOffsets>

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetPartitionsAssignedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartition>>)

Sets the handler to call on partitions assigned events.

IConfluentConsumerBuilder SetPartitionsAssignedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartition>> partitionsAssignedHandler)

Parameters

partitionsAssignedHandler Action<IConsumer<byte[], byte[]>, List<TopicPartition>>

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetPartitionsAssignedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartition>, IEnumerable<TopicPartitionOffset>>)

Sets the handler to call on partitions assigned events.

IConfluentConsumerBuilder SetPartitionsAssignedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartition>, IEnumerable<TopicPartitionOffset>> partitionsAssignedHandler)

Parameters

partitionsAssignedHandler Func<IConsumer<byte[], byte[]>, List<TopicPartition>, IEnumerable<TopicPartitionOffset>>

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetPartitionsRevokedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>>)

Sets the handler to call on partitions revoked events.

IConfluentConsumerBuilder SetPartitionsRevokedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>> partitionsRevokedHandler)

Parameters

partitionsRevokedHandler Action<IConsumer<byte[], byte[]>, List<TopicPartitionOffset>>

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

SetPartitionsRevokedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>, IEnumerable<TopicPartitionOffset>>)

Sets the handler to call on partitions revoked events.

IConfluentConsumerBuilder SetPartitionsRevokedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>, IEnumerable<TopicPartitionOffset>> partitionsRevokedHandler)

Parameters

partitionsRevokedHandler Func<IConsumer<byte[], byte[]>, List<TopicPartitionOffset>, IEnumerable<TopicPartitionOffset>>

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.

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

Sets the handler to call on statistics events.

IConfluentConsumerBuilder SetStatisticsHandler(Action<IConsumer<byte[]?, byte[]?>, string> statisticsHandler)

Parameters

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

The event handler.

Returns

IConfluentConsumerBuilder

The IConfluentConsumerBuilder so that additional calls can be chained.