Interface KafkaRecord<K,T>
- All Superinterfaces:
ContextAwareMessage<T>,org.eclipse.microprofile.reactive.messaging.Message<T>
- All Known Subinterfaces:
KafkaMessage<K,T>
- All Known Implementing Classes:
IncomingKafkaRecord,OutgoingKafkaRecord
public interface KafkaRecord<K,T>
extends org.eclipse.microprofile.reactive.messaging.Message<T>, ContextAwareMessage<T>
-
Field Summary
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
EMPTY_ACK, EMPTY_NACK, LOGGER -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,T> OutgoingKafkaRecord<K, T> from(org.eclipse.microprofile.reactive.messaging.Message<T> message) org.apache.kafka.common.header.HeadersgetKey()intgetTopic()static <K,T> OutgoingKafkaRecord<K, T> Creates a new outgoing Kafka record.static <K,T> OutgoingKafkaRecord<K, T> 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 io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContextMethods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, ack, addMetadata, getAck, getAckWithMetadata, getMetadata, getMetadata, getNack, getNackWithMetadata, getPayload, nack, nack, thenApply, unwrap, withAck, withAckWithMetadata, withMetadata, withMetadata, withNack, withNackWithMetadata, withPayload
-
Method Details
-
from
static <K,T> OutgoingKafkaRecord<K,T> from(org.eclipse.microprofile.reactive.messaging.Message<T> message) -
of
Creates a new outgoing Kafka record.- Type Parameters:
K- the type of the keyT- the type of the value- Parameters:
key- the key, can benullvalue- the value / payload, must not benull- Returns:
- the new outgoing Kafka record
-
of
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 benullkey- the key, can benullvalue- 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 benullkey- the key, can benullvalue- the value / payload, must not benulltimestamp- the timestamp, can be null to indicate no timestamppartition- the partition, can be-1to 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()
-