Package io.vertx.kafka.client.producer
Interface KafkaProducerRecord<K,V>
-
public interface KafkaProducerRecord<K,V>
Vert.x Kafka producer record.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description KafkaProducerRecord<K,V>
addHeader(KafkaHeader header)
Add an header to this record.KafkaProducerRecord<K,V>
addHeader(String key, Buffer value)
LikeaddHeader(KafkaHeader)
but with a key/value pairKafkaProducerRecord<K,V>
addHeader(String key, String value)
LikeaddHeader(KafkaHeader)
but with a key/value pairKafkaProducerRecord<K,V>
addHeaders(List<KafkaHeader> headers)
Add a list of headers to this record.static <K,V>
KafkaProducerRecord<K,V>create(String topic, K key, V value)
Create a concrete instance of a Vert.x producer recordstatic <K,V>
KafkaProducerRecord<K,V>create(String topic, K key, V value, Integer partition)
Create a concrete instance of a Vert.x producer recordstatic <K,V>
KafkaProducerRecord<K,V>create(String topic, K key, V value, Long timestamp, Integer partition)
Create a concrete instance of a Vert.x producer recordstatic <K,V>
KafkaProducerRecord<K,V>create(String topic, V value)
Create a concrete instance of a Vert.x producer recordList<KafkaHeader>
headers()
K
key()
Integer
partition()
org.apache.kafka.clients.producer.ProducerRecord<K,V>
record()
Long
timestamp()
String
topic()
V
value()
-
-
-
Method Detail
-
create
static <K,V> KafkaProducerRecord<K,V> create(String topic, K key, V value, Long timestamp, Integer partition)
Create a concrete instance of a Vert.x producer record- Type Parameters:
K
- key typeV
- value type- Parameters:
topic
- the topic this record is being sent tokey
- the key (or null if no key is specified)value
- the valuetimestamp
- the timestamp of this recordpartition
- the partition to which the record will be sent (or null if no partition was specified)- Returns:
- Vert.x producer record
-
create
static <K,V> KafkaProducerRecord<K,V> create(String topic, K key, V value, Integer partition)
Create a concrete instance of a Vert.x producer record- Type Parameters:
K
- key typeV
- value type- Parameters:
topic
- the topic this record is being sent tokey
- the key (or null if no key is specified)value
- the valuepartition
- the partition to which the record will be sent (or null if no partition was specified)- Returns:
- Vert.x producer record
-
create
static <K,V> KafkaProducerRecord<K,V> create(String topic, K key, V value)
Create a concrete instance of a Vert.x producer record- Type Parameters:
K
- key typeV
- value type- Parameters:
topic
- the topic this record is being sent tokey
- the key (or null if no key is specified)value
- the value- Returns:
- Vert.x producer record
-
create
static <K,V> KafkaProducerRecord<K,V> create(String topic, V value)
Create a concrete instance of a Vert.x producer record- Type Parameters:
K
- key typeV
- value type- Parameters:
topic
- the topic this record is being sent tovalue
- the value- Returns:
- Vert.x producer record
-
topic
String topic()
- Returns:
- the topic this record is being sent to
-
key
K key()
- Returns:
- the key (or null if no key is specified)
-
value
V value()
- Returns:
- the value
-
timestamp
Long timestamp()
- Returns:
- the timestamp of this record
-
partition
Integer partition()
- Returns:
- the partition to which the record will be sent (or null if no partition was specified)
-
addHeader
KafkaProducerRecord<K,V> addHeader(String key, String value)
LikeaddHeader(KafkaHeader)
but with a key/value pair
-
addHeader
KafkaProducerRecord<K,V> addHeader(String key, Buffer value)
LikeaddHeader(KafkaHeader)
but with a key/value pair
-
addHeader
KafkaProducerRecord<K,V> addHeader(KafkaHeader header)
Add an header to this record.- Parameters:
header
- the header- Returns:
- current KafkaProducerRecord instance
-
addHeaders
KafkaProducerRecord<K,V> addHeaders(List<KafkaHeader> headers)
Add a list of headers to this record.- Parameters:
headers
- the headers- Returns:
- current KafkaProducerRecord instance
-
headers
List<KafkaHeader> headers()
- Returns:
- the headers of this record
-
-