Class MockedConfluentProducerBuilder
- Namespace
- Silverback.Messaging.Broker.Kafka
- Assembly
- Silverback.Integration.Kafka.Testing.dll
The builder for the Silverback.Messaging.Broker.Kafka.Mocks.MockedConfluentProducer.
public class MockedConfluentProducerBuilder : IConfluentProducerBuilder
- Inheritance
-
MockedConfluentProducerBuilder
- Implements
- Inherited Members
Constructors
MockedConfluentProducerBuilder(IInMemoryTopicCollection, IInMemoryTransactionManager)
Initializes a new instance of the MockedConfluentProducerBuilder class.
public MockedConfluentProducerBuilder(IInMemoryTopicCollection topics, IInMemoryTransactionManager transactionManager)
Parameters
topicsIInMemoryTopicCollectiontransactionManagerIInMemoryTransactionManager
Methods
Build()
Builds the Confluent.Kafka.IProducer<TKey, TValue> instance.
public IProducer<byte[]?, byte[]?> Build()
Returns
SetConfiguration(ProducerConfig)
Sets the producer configuration.
public IConfluentProducerBuilder SetConfiguration(ProducerConfig config)
Parameters
configProducerConfigThe 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
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
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
Returns
- IConfluentProducerBuilder
The IConfluentProducerBuilder so that additional calls can be chained.