Class OutgoingKafkaRecord<K,T>
java.lang.Object
io.smallrye.reactive.messaging.kafka.OutgoingKafkaRecord<K,T>
- All Implemented Interfaces:
KafkaRecord<K,,T> ContextAwareMessage<T>,org.eclipse.microprofile.reactive.messaging.Message<T>
-
Field Summary
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
EMPTY_ACK, EMPTY_NACK, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionOutgoingKafkaRecord(String topic, K key, T value, Instant timestamp, int partition, org.apache.kafka.common.header.Headers headers, Function<org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> ack, BiFunction<Throwable, org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> nack, org.eclipse.microprofile.reactive.messaging.Metadata existingMetadata) -
Method Summary
Modifier and TypeMethodDescriptionack(org.eclipse.microprofile.reactive.messaging.Metadata metadata) static <K,T> OutgoingKafkaRecord<K, T> from(org.eclipse.microprofile.reactive.messaging.Message<T> message) Function<org.eclipse.microprofile.reactive.messaging.Metadata,CompletionStage<Void>> org.apache.kafka.common.header.HeadersgetKey()org.eclipse.microprofile.reactive.messaging.MetadataBiFunction<Throwable,org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> intgetTopic()withAck(Supplier<CompletionStage<Void>> supplier) withHeader(String key, byte[] content) Creates a new outgoing Kafka Message with a header added to the header list.withHeader(String key, String content) Creates a new outgoing Kafka Message with a header added to the header list.withHeader(String key, String content, Charset enc) Creates a new outgoing Kafka Message with a header added to the header list.withMetadata(Iterable<Object> metadata) withMetadata(org.eclipse.microprofile.reactive.messaging.Metadata metadata) withNack(Function<Throwable, CompletionStage<Void>> nack) <P> OutgoingKafkaRecord<K,P> withPayload(P payload) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContextMethods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, addMetadata, getAck, getMetadata, getNack, nack, nack, thenApply, unwrap, withAckWithMetadata, withNackWithMetadata
-
Constructor Details
-
OutgoingKafkaRecord
public OutgoingKafkaRecord(String topic, K key, T value, Instant timestamp, int partition, org.apache.kafka.common.header.Headers headers, Function<org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> ack, BiFunction<Throwable, org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> nack, org.eclipse.microprofile.reactive.messaging.Metadata existingMetadata)
-
-
Method Details
-
from
public static <K,T> OutgoingKafkaRecord<K,T> from(org.eclipse.microprofile.reactive.messaging.Message<T> message) -
ack
- Specified by:
ackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getPayload
- Specified by:
getPayloadin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getKey
- Specified by:
getKeyin interfaceKafkaRecord<K,T>
-
getTopic
- Specified by:
getTopicin interfaceKafkaRecord<K,T>
-
getTimestamp
- Specified by:
getTimestampin interfaceKafkaRecord<K,T>
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()- Specified by:
getHeadersin interfaceKafkaRecord<K,T>
-
getAckWithMetadata
public Function<org.eclipse.microprofile.reactive.messaging.Metadata,CompletionStage<Void>> getAckWithMetadata()- Specified by:
getAckWithMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getNackWithMetadata
public BiFunction<Throwable,org.eclipse.microprofile.reactive.messaging.Metadata, getNackWithMetadata()CompletionStage<Void>> - Specified by:
getNackWithMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getPartition
public int getPartition()- Specified by:
getPartitionin interfaceKafkaRecord<K,T>
-
getMetadata
public org.eclipse.microprofile.reactive.messaging.Metadata getMetadata()- Specified by:
getMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
withHeader
Creates a new outgoing Kafka Message with a header added to the header list.- Parameters:
key- the header keycontent- the header key, must not benull- Returns:
- the updated Kafka Message.
-
withHeader
Creates a new outgoing Kafka Message with a header added to the header list.- Parameters:
key- the header keycontent- the header key, must not benull- Returns:
- the updated Kafka Message.
-
withHeader
Creates a new outgoing Kafka Message with a header added to the header list.- Parameters:
key- the header keycontent- the header key, must not benullenc- the encoding, must not benull- Returns:
- the updated Kafka Message.
-
with
-
with
-
with
-
withPayload
- Specified by:
withPayloadin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
withMetadata
- Specified by:
withMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
withMetadata
public OutgoingKafkaRecord<K,T> withMetadata(org.eclipse.microprofile.reactive.messaging.Metadata metadata) - Specified by:
withMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
withAck
- Specified by:
withAckin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
withNack
- Specified by:
withNackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-