Class ConfluentConsumerBuilder
- Namespace
- Silverback.Messaging.Broker.Kafka
- Assembly
- Silverback.Integration.Kafka.dll
Wraps the Confluent.Kafka.ConsumerBuilder<TKey, TValue>.
public class ConfluentConsumerBuilder : IConfluentConsumerBuilder
- Inheritance
-
ConfluentConsumerBuilder
- Implements
- Inherited Members
Constructors
ConfluentConsumerBuilder()
public ConfluentConsumerBuilder()
Methods
Build()
Builds the Confluent.Kafka.IConsumer<TKey, TValue> instance.
public IConsumer<byte[]?, byte[]?> Build()
Returns
SetConfig(ConsumerConfig)
Sets the consumer configuration.
public IConfluentConsumerBuilder SetConfig(ConsumerConfig config)
Parameters
configConsumerConfigThe 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.
public IConfluentConsumerBuilder SetErrorHandler(Action<IConsumer<byte[]?, byte[]?>, Error> errorHandler)
Parameters
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.
public IConfluentConsumerBuilder SetLogHandler(Action<IConsumer<byte[]?, byte[]?>, LogMessage> logHandler)
Parameters
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.
public IConfluentConsumerBuilder SetOffsetsCommittedHandler(Action<IConsumer<byte[]?, byte[]?>, CommittedOffsets> offsetsCommittedHandler)
Parameters
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.
public IConfluentConsumerBuilder SetPartitionsAssignedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartition>> partitionsAssignedHandler)
Parameters
partitionsAssignedHandlerAction<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.
public IConfluentConsumerBuilder SetPartitionsAssignedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartition>, IEnumerable<TopicPartitionOffset>> partitionsAssignedHandler)
Parameters
partitionsAssignedHandlerFunc<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.
public IConfluentConsumerBuilder SetPartitionsRevokedHandler(Action<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>> partitionsRevokedHandler)
Parameters
partitionsRevokedHandlerAction<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.
public IConfluentConsumerBuilder SetPartitionsRevokedHandler(Func<IConsumer<byte[]?, byte[]?>, List<TopicPartitionOffset>, IEnumerable<TopicPartitionOffset>> partitionsRevokedHandler)
Parameters
partitionsRevokedHandlerFunc<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.
public IConfluentConsumerBuilder SetStatisticsHandler(Action<IConsumer<byte[]?, byte[]?>, string> statisticsHandler)
Parameters
Returns
- IConfluentConsumerBuilder
The IConfluentConsumerBuilder so that additional calls can be chained.