RecordAndMetadata Class
Description
A case class that represents a platform stream record. The class exposes methods for extracting decoded record data and related metadata.
Summary
case class RecordAndMetadata[V](
topic: String,
partitionId: Short,
private val rec: ConsumerRecord,
valueDecoder: Decoder[V])
extends Encoding with Logging
-
def payload(): V
-
def payloadWithMetadata(): PayloadWithMetadata[V]
Instance Constructors
Syntax
RecordAndMetadata[V](
topic: String,
partitionId: Short,
private val rec: ConsumerRecord,
valueDecoder: Decoder[V])
Parameters and Data Members
- topic
The name of the stream that contains the record.
- Type: String
- Requirement: Required
- partitionId
The ID of the stream shard that contains the record (see Stream Sharding and Partitioning).
- Type:
Short
- Requirement: Required
- Type:
- valueDecoder
A decoder instance for converting the record's data into the desired type — the value type of the current class instance (see the
V type parameter).- Requirement: Required
Type Parameters
V — the data type into which to convert the record data ("value").
payload Method
Returns decoded record data ("payload"), in the specified format.
Syntax
payload(): V
Parameters
None
Return Value
Returns the decoded record data, formatted as the value type of the current class instance (see the constructor's
payloadWithMetadata Method
Returns decoded record data ("payload"), in the specified format, and related metadata.
Syntax
payloadWithMetadata(): PayloadWithMetadata[V]
Parameters
None
Return Value
Returns a