Table of Contents

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

name string

The name of the topic. Must not be empty.

clientConfig ClientConfig

The 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

name string

The name of the topic. Must not be empty.

bootstrapServers string

The 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

name string

The name of the topic. Must not be empty.

bootstrapServers string

The bootstrap servers string used to identify the target broker. Must not be empty.

partitions int?

The number of partitions, or null to use the number configured in the mock options. If specified, it must be greater than or equal to 1.

Returns

bool

true if the topic has been created, false if it already exists.