Class MockedConfluentProducerBuilder
The builder for the Silverback.
Implements
Inherited Members
Namespace: Silverback.Messaging.Broker.Kafka
Assembly: Silverback.Integration.Kafka.Testing.dll
Syntax
public class MockedConfluentProducerBuilder : IConfluentProducerBuilder
Constructors
| Improve this doc View sourceMockedConfluentProducerBuilder(IServiceProvider)
Initializes a new instance of the Mocked
Declaration
public MockedConfluentProducerBuilder(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IService |
serviceProvider | The IService |
Methods
| Improve this doc View sourceBuild()
Builds the Confluent.Kafka.IProducer<TKey, TValue> instance.
Declaration
public IProducer<byte[]?, byte[]?> Build()
Returns
| Improve this doc View sourceSetConfig(ProducerConfig)
Sets the producer configuration.
Declaration
public IConfluentProducerBuilder SetConfig(ProducerConfig config)
Parameters
Type | Name | Description |
---|---|---|
Producer |
config | The configuration. |
Returns
Type | Description |
---|---|
IConfluent |
The IConfluent |
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.
Declaration
public IConfluentProducerBuilder SetLogHandler(Action<IProducer<byte[]?, byte[]?>, LogMessage> logHandler)
Parameters
Returns
Type | Description |
---|---|
IConfluent |
The IConfluent |
SetStatisticsHandler(Action<IProducer<byte[]?, byte[]?>, string>)
Sets the handler to call on statistics events.
Declaration
public IConfluentProducerBuilder SetStatisticsHandler(Action<IProducer<byte[]?, byte[]?>, string> statisticsHandler)
Parameters
Type | Name | Description |
---|---|---|
Action<IProducer<byte[], byte[]>, string> | statisticsHandler | The event handler. |
Returns
Type | Description |
---|---|
IConfluent |
The IConfluent |