Interface IInMemoryTopicCollection
- Namespace
- Silverback.Messaging.Broker.Kafka.Mocks
- Assembly
- Silverback.Integration.Kafka.Testing.dll
The collection of Silverback.Messaging.Broker.Kafka.Mocks.InMemoryTopic being used in the current session.
public interface IInMemoryTopicCollection : IReadOnlyCollection<IInMemoryTopic>, IEnumerable<IInMemoryTopic>, IEnumerable
- Inherited Members
Methods
Get(string, ClientConfig)
Gets the topic with the specified name or creates it on the fly.
IInMemoryTopic Get(string name, ClientConfig clientConfig)
Parameters
namestringThe name of the topic. Must not be empty.
clientConfigClientConfigThe client configuration. Its bootstrap servers must be set and must not be empty.
Returns
- IInMemoryTopic
The in-memory topic.
Get(string, string)
Gets the topic with the specified name or creates it on the fly.
IInMemoryTopic Get(string name, string bootstrapServers)
Parameters
namestringThe name of the topic. Must not be empty.
bootstrapServersstringThe bootstrap servers string used to identify the target broker. Must not be empty.
Returns
- IInMemoryTopic
The in-memory topic.
TryCreate(string, string, int?)
Creates the topic with the specified name, unless it already exists.
bool TryCreate(string name, string bootstrapServers, int? partitions = null)
Parameters
namestringThe name of the topic. Must not be empty.
bootstrapServersstringThe bootstrap servers string used to identify the target broker. Must not be empty.
partitionsint?The number of partitions, or
nullto use the number configured in the mock options. If specified, it must be greater than or equal to 1.
Returns
- bool
trueif the topic has been created,falseif it already exists.