Class IncomingKafkaRecordBatch<K,T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.IncomingKafkaRecordBatch<K,T>
-
- All Implemented Interfaces:
KafkaRecordBatch<K,T>,ContextAwareMessage<List<T>>,Iterable<KafkaRecord<K,T>>,org.eclipse.microprofile.reactive.messaging.Message<List<T>>
public class IncomingKafkaRecordBatch<K,T> extends Object implements KafkaRecordBatch<K,T>
-
-
Constructor Summary
Constructors Constructor Description IncomingKafkaRecordBatch(org.apache.kafka.clients.consumer.ConsumerRecords<K,T> records, String channel, int index, KafkaCommitHandler commitHandler, KafkaFailureHandler onNack, boolean cloudEventEnabled, boolean tracingEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>ack()Supplier<CompletionStage<Void>>getAck()Map<org.apache.kafka.common.TopicPartition,KafkaRecord<K,T>>getLatestOffsetRecords()org.eclipse.microprofile.reactive.messaging.MetadatagetMetadata()Function<Throwable,CompletionStage<Void>>getNack()List<T>getPayload()List<KafkaRecord<K,T>>getRecords()Iterator<KafkaRecord<K,T>>iterator()CompletionStage<Void>nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContext
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
IncomingKafkaRecordBatch
public IncomingKafkaRecordBatch(org.apache.kafka.clients.consumer.ConsumerRecords<K,T> records, String channel, int index, KafkaCommitHandler commitHandler, KafkaFailureHandler onNack, boolean cloudEventEnabled, boolean tracingEnabled)
-
-
Method Detail
-
getPayload
public List<T> getPayload()
- Specified by:
getPayloadin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getRecords
public List<KafkaRecord<K,T>> getRecords()
- Specified by:
getRecordsin interfaceKafkaRecordBatch<K,T>- Returns:
- list of records contained in this message batch
-
iterator
public Iterator<KafkaRecord<K,T>> iterator()
-
getLatestOffsetRecords
public Map<org.apache.kafka.common.TopicPartition,KafkaRecord<K,T>> getLatestOffsetRecords()
- Specified by:
getLatestOffsetRecordsin interfaceKafkaRecordBatch<K,T>- Returns:
- map of records with latest offset by topic partition
-
getMetadata
public org.eclipse.microprofile.reactive.messaging.Metadata getMetadata()
- Specified by:
getMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getAck
public Supplier<CompletionStage<Void>> getAck()
- Specified by:
getAckin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
getNack
public Function<Throwable,CompletionStage<Void>> getNack()
- Specified by:
getNackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
ack
public CompletionStage<Void> ack()
- Specified by:
ackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
nack
public CompletionStage<Void> nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)
- Specified by:
nackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<K>
-
-