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
|
ConsumerRecord(java.lang.String topic,
int partition,
long offset,
K key,
V value,
long timestamp,
java.lang.String producer)
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 |
producer()
The producer for this record.
|
long |
timestamp()
The timestamp at which this record was produced.
|
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 ConsumerRecord(java.lang.String topic, int partition, long offset, K key, V value, long timestamp, java.lang.String producer)
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 contentstimestamp
- The timestamp at which the record was producedproducer
- The producer for this recordpublic java.lang.String topic()
public int partition()
public K key()
public V value()
public long offset()
public long timestamp()
public java.lang.String producer()
public java.lang.String toString()
toString
in class java.lang.Object