Interface KafkaRecord<K,T>
-
- All Superinterfaces:
Message<T>
- All Known Subinterfaces:
KafkaMessage<K,T>
- All Known Implementing Classes:
IncomingKafkaRecord
,OutgoingKafkaRecord
public interface KafkaRecord<K,T> extends Message<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.kafka.common.header.Headers
getHeaders()
K
getKey()
int
getPartition()
Instant
getTimestamp()
String
getTopic()
static <K,T>
OutgoingKafkaRecord<K,T>of(String topic, K key, T value)
Creates a new outgoing Kafka record.static <K,T>
OutgoingKafkaRecord<K,T>of(String topic, K key, T value, Instant timestamp, int partition)
Creates a new outgoing Kafka record.static <K,T>
OutgoingKafkaRecord<K,T>of(K key, T value)
Creates a new outgoing Kafka record.-
Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, addMetadata, getAck, getMetadata, getMetadata, getPayload, unwrap, withAck, withMetadata, withMetadata, withPayload
-
-
-
-
Method Detail
-
of
static <K,T> OutgoingKafkaRecord<K,T> of(K key, T value)
Creates a new outgoing Kafka record.- Type Parameters:
K
- the type of the keyT
- the type of the value- Parameters:
key
- the key, can benull
value
- the value / payload, must not benull
- Returns:
- the new outgoing Kafka record
-
of
static <K,T> OutgoingKafkaRecord<K,T> of(String topic, K key, T value)
Creates a new outgoing Kafka record.- Type Parameters:
K
- the type of the keyT
- the type of the value- Parameters:
topic
- the topic, must not benull
key
- the key, can benull
value
- the value / payload, must not benull
- Returns:
- the new outgoing Kafka record
-
of
static <K,T> OutgoingKafkaRecord<K,T> of(String topic, K key, T value, Instant timestamp, int partition)
Creates a new outgoing Kafka record.- Type Parameters:
K
- the type of the keyT
- the type of the value- Parameters:
topic
- the topic, must not benull
key
- the key, can benull
value
- the value / payload, must not benull
timestamp
- the timestamp, can be null to indicate no timestamppartition
- the partition, can be-1
to indicate no partition- Returns:
- the new outgoing Kafka record
-
getKey
K getKey()
-
getTopic
String getTopic()
-
getPartition
int getPartition()
-
getTimestamp
Instant getTimestamp()
-
getHeaders
org.apache.kafka.common.header.Headers getHeaders()
-
-