Class ConsumeResult<TKey, TValue>
Represents the result of consuming a message from a Kafka topic.
public sealed class ConsumeResult<TKey, TValue>
Type Parameters
TKeyThe type of the message key.
TValueThe type of the message value.
- Inheritance
-
ConsumeResult<TKey, TValue>
- Inherited Members
- Extension Methods
Remarks
Encapsulates the key, value, and metadata (topic, partition, offset, timestamp) for a consumed Kafka message. This is a framework-level abstraction that decouples stream processors from specific Kafka client library types.
Properties
Headers
Gets or sets the message headers.
public IReadOnlyDictionary<string, byte[]> Headers { get; set; }
Property Value
- IReadOnlyDictionary<string, byte[]>
The message headers. Default is an empty dictionary.
Key
Gets or sets the message key.
public TKey? Key { get; set; }
Property Value
- TKey
The message key.
Offset
Gets or sets the offset of the message within the partition.
public long Offset { get; set; }
Property Value
- long
The message offset.
Partition
Gets or sets the partition the message was consumed from.
public int Partition { get; set; }
Property Value
- int
The partition number.
Timestamp
Gets or sets the timestamp of the message.
public DateTimeOffset Timestamp { get; set; }
Property Value
- DateTimeOffset
The message timestamp.
Topic
Gets or sets the topic the message was consumed from.
public string Topic { get; set; }
Property Value
- string
The topic name.
Value
Gets or sets the message value.
public TValue? Value { get; set; }
Property Value
- TValue
The message value.