Interface IInMemoryPartition
A mocked topic partition where the messages are just stored in memory.
Namespace: Silverback.Messaging.Broker.Kafka.Mocks
Assembly: Silverback.Integration.Kafka.Testing.dll
Syntax
public interface IInMemoryPartition
Properties
| Improve this doc View sourceFirstOffset
Gets the Confluent.Kafka.Offset of the first message in the partition.
Declaration
Offset FirstOffset { get; }
Property Value
Type | Description |
---|---|
Offset |
LastOffset
Gets the Confluent.Kafka.Offset of the latest message in the partition.
Declaration
Offset LastOffset { get; }
Property Value
Type | Description |
---|---|
Offset |
Partition
Gets the Partition (index).
Declaration
Partition Partition { get; }
Property Value
Type | Description |
---|---|
Partition |
TotalMessagesCount
Gets the total number of messages written to the partition.
Declaration
int TotalMessagesCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this doc View sourceGetAllMessages()
Gets all messages currently stored in the partition.
Declaration
IReadOnlyCollection<Message<byte[]?, byte[]?>> GetAllMessages()
Returns
Type | Description |
---|---|
IReadOnlyCollection<Message<byte[], byte[]>> | The messages. |
TryPull(Offset, out ConsumeResult<byte[]?, byte[]?>?)
Pulls the next message from the partition, if available.
Declaration
bool TryPull(Offset offset, out ConsumeResult<byte[]?, byte[]?>? result)
Parameters
Type | Name | Description |
---|---|---|
Offset | offset | The offset of the next message to be pulled. |
ConsumeResult<byte[], byte[]> | result | The Confluent.Kafka.ConsumeResult<TKey, TValue> wrapping the pulled message. |
Returns
Type | Description |
---|---|
bool | A value indicating whether a message was available for pulling. |