Interface IMockedKafkaOptionsBuilder
Exposes the methods to configure the mocked Kafka.
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.Testing.dll
Syntax
public interface IMockedKafkaOptionsBuilder
Methods
| Improve this doc View sourceDelayPartitionsAssignment(TimeSpan)
Specifies the delay to be applied before assigning the partitions.
Declaration
IMockedKafkaOptionsBuilder DelayPartitionsAssignment(TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | delay | The delay to be applied before assigning the partitions. |
Returns
Type | Description |
---|---|
IMockedKafkaOptionsBuilder | The IMockedKafkaOptionsBuilder so that additional calls can be chained. |
OverrideAutoCommitIntervalMs(Nullable<Int32>)
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.
Declaration
IMockedKafkaOptionsBuilder OverrideAutoCommitIntervalMs(int? intervalMs)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Int32> | intervalMs | The desired auto commit interval in milliseconds. |
Returns
Type | Description |
---|---|
IMockedKafkaOptionsBuilder | The IMockedKafkaOptionsBuilder so that additional calls can be chained. |
Remarks
This is necessary to speed up the tests, since the WaitUntilAllMessagesAreConsumedAsync(Nullable<TimeSpan>) method waits until the offsets are committed.
WithDefaultPartitionsCount(Int32)
Specifies the default number of partitions to be created per each topic. The default is 5.
Declaration
IMockedKafkaOptionsBuilder WithDefaultPartitionsCount(int partitionsCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | partitionsCount | The number of partitions. |
Returns
Type | Description |
---|---|
IMockedKafkaOptionsBuilder | The IMockedKafkaOptionsBuilder so that additional calls can be chained. |
WithPartitionsCount(String, Int32)
Specify the default number of partitions to be created for the topic.
Declaration
IMockedKafkaOptionsBuilder WithPartitionsCount(string topicName, int partitionsCount)
Parameters
Type | Name | Description |
---|---|---|
System.String | topicName | The name of the topic. |
System.Int32 | partitionsCount | The number of partitions. |
Returns
Type | Description |
---|---|
IMockedKafkaOptionsBuilder | The IMockedKafkaOptionsBuilder so that additional calls can be chained. |