public class IncomingKafkaRecord<K,T> extends Object implements KafkaRecord<K,T>
| Constructor and Description |
|---|
IncomingKafkaRecord(org.apache.kafka.clients.consumer.ConsumerRecord<K,T> record,
KafkaCommitHandler commitHandler,
KafkaFailureHandler onNack,
boolean cloudEventEnabled,
boolean tracingEnabled) |
| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
ack()
Acknowledge this message.
|
Supplier<CompletionStage<Void>> |
getAck() |
org.apache.kafka.common.header.Headers |
getHeaders() |
K |
getKey() |
Metadata |
getMetadata() |
Function<Throwable,CompletionStage<Void>> |
getNack() |
long |
getOffset() |
int |
getPartition() |
T |
getPayload() |
Instant |
getTimestamp() |
String |
getTopic() |
void |
injectTracingMetadata(TracingMetadata tracingMetadata) |
CompletionStage<Void> |
nack(Throwable reason,
Metadata metadata)
Acknowledge negatively this message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfrom, of, of, ofaddMetadata, getMetadata, nack, of, of, of, unwrap, withAck, withMetadata, withMetadata, withNack, withPayloadpublic IncomingKafkaRecord(org.apache.kafka.clients.consumer.ConsumerRecord<K,T> record, KafkaCommitHandler commitHandler, KafkaFailureHandler onNack, boolean cloudEventEnabled, boolean tracingEnabled)
public T getPayload()
getPayload in interface Message<T>public K getKey()
getKey in interface KafkaRecord<K,T>public String getTopic()
getTopic in interface KafkaRecord<K,T>public int getPartition()
getPartition in interface KafkaRecord<K,T>public Instant getTimestamp()
getTimestamp in interface KafkaRecord<K,T>public org.apache.kafka.common.header.Headers getHeaders()
getHeaders in interface KafkaRecord<K,T>public long getOffset()
public Metadata getMetadata()
getMetadata in interface Message<T>public Supplier<CompletionStage<Void>> getAck()
getAck in interface Message<T>CompletionStage.public Function<Throwable,CompletionStage<Void>> getNack()
public CompletionStage<Void> ack()
Messagepublic CompletionStage<Void> nack(Throwable reason, Metadata metadata)
Messagenack is used to indicate that the processing of a message failed. The reason is passed as parameter.
Additional metadata may be provided that the connector can use when nacking the message. The interpretation
of metadata is connector-specific.nack in interface Message<T>reason - the reason of the nack, must not be nullmetadata - additional nack metadata the connector may use, may be nullpublic void injectTracingMetadata(TracingMetadata tracingMetadata)
Copyright © 2018–2021 SmallRye. All rights reserved.