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 |
---|---|
Confluent.Kafka.Offset |
LastOffset
Gets the Confluent.Kafka.Offset of the latest message in the partition.
Declaration
Offset LastOffset { get; }
Property Value
Type | Description |
---|---|
Confluent.Kafka.Offset |
Partition
Gets the Partition (index).
Declaration
Partition Partition { get; }
Property Value
Type | Description |
---|---|
Confluent.Kafka.Partition |
TotalMessagesCount
Gets the total number of messages written to the partition.
Declaration
int TotalMessagesCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this doc View sourceGetAllMessages()
Gets all messages currently stored in the partition.
Declaration
IReadOnlyCollection<Message<byte[], byte[]>> GetAllMessages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<Confluent.Kafka.Message<System.Byte[], System.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 |
---|---|---|
Confluent.Kafka.Offset | offset | The offset of the next message to be pulled. |
Confluent.Kafka.ConsumeResult<System.Byte[], System.Byte[]> | result | The Confluent.Kafka.ConsumeResult<TKey, TValue> wrapping the pulled message. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether a message was available for pulling. |