public final class ConsumerRecord<K,V>
extends java.lang.Object
Constructor and Description |
---|
ConsumerRecord(java.lang.String topic,
int partition,
long offset,
K key,
V value)
Creates a record to be received from a specified topic and partition
|
Modifier and Type | Method and Description |
---|---|
K |
key()
The key (or null if no key is specified)
|
long |
offset()
The position of this record in the corresponding Kafka partition.
|
int |
partition()
The partition from which this record is received
|
java.lang.String |
topic()
The topic this record is received from
|
java.lang.String |
toString() |
V |
value()
The value
|
public ConsumerRecord(java.lang.String topic, int partition, long offset, K key, V value)
topic
- The topic this record is received frompartition
- The partition of the topic this record is received fromoffset
- The offset of this record in the corresponding Kafka partitionkey
- The key of the record, if one exists (null is allowed)value
- The record contentspublic java.lang.String topic()
public int partition()
public K key()
public V value()
public long offset()
public java.lang.String toString()
toString
in class java.lang.Object