Interface IMockedKafkaOptionsBuilder
- Namespace
- Silverback.Messaging.Configuration.Kafka
- Assembly
- Silverback.Integration.Kafka.Testing.dll
Exposes the methods to configure the mocked Kafka.
public interface IMockedKafkaOptionsBuilder
Methods
DelayPartitionsAssignment(TimeSpan)
Specifies the delay to be applied before assigning the partitions.
IMockedKafkaOptionsBuilder DelayPartitionsAssignment(TimeSpan delay)
Parameters
delayTimeSpanThe delay to be applied before assigning the partitions.
Returns
- IMockedKafkaOptionsBuilder
The IMockedKafkaOptionsBuilder so that additional calls can be chained.
OverrideAutoCommitIntervalMs(int?)
Specifies the value to be used instead of the default 5 seconds or the configured
AutoCommitIntervalMs for the inbound topics. Set it to
null to disable the feature. The default is 10 milliseconds.
IMockedKafkaOptionsBuilder OverrideAutoCommitIntervalMs(int? intervalMs)
Parameters
intervalMsint?The desired auto commit interval in milliseconds.
Returns
- IMockedKafkaOptionsBuilder
The IMockedKafkaOptionsBuilder so that additional calls can be chained.
Remarks
This is necessary to speed up the tests, since the WaitUntilAllMessagesAreConsumedAsync(params string[]) method and its overloads wait until the offsets are committed.
WithDefaultPartitionsCount(int)
Specifies the default number of partitions to be created per each topic. The default is 5.
IMockedKafkaOptionsBuilder WithDefaultPartitionsCount(int partitionsCount)
Parameters
partitionsCountintThe number of partitions.
Returns
- IMockedKafkaOptionsBuilder
The IMockedKafkaOptionsBuilder so that additional calls can be chained.
WithPartitionsCount(string, int)
Specifies the default number of partitions to be created for the topic.
IMockedKafkaOptionsBuilder WithPartitionsCount(string topicName, int partitionsCount)
Parameters
Returns
- IMockedKafkaOptionsBuilder
The IMockedKafkaOptionsBuilder so that additional calls can be chained.