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 Details

    • 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 Details

    • getPayload

      public List<T> getPayload()
      Specified by:
      getPayload in interface org.eclipse.microprofile.reactive.messaging.Message<K>
    • getRecords

      public List<KafkaRecord<K,T>> getRecords()
      Specified by:
      getRecords in interface KafkaRecordBatch<K,T>
      Returns:
      list of records contained in this message batch
    • iterator

      public Iterator<KafkaRecord<K,T>> iterator()
      Specified by:
      iterator in interface Iterable<K>
    • getLatestOffsetRecords

      public Map<org.apache.kafka.common.TopicPartition,KafkaRecord<K,T>> getLatestOffsetRecords()
      Specified by:
      getLatestOffsetRecords in interface KafkaRecordBatch<K,T>
      Returns:
      map of records with latest offset by topic partition
    • getMetadata

      public org.eclipse.microprofile.reactive.messaging.Metadata getMetadata()
      Specified by:
      getMetadata in interface org.eclipse.microprofile.reactive.messaging.Message<K>
    • getAck

      public Supplier<CompletionStage<Void>> getAck()
      Specified by:
      getAck in interface org.eclipse.microprofile.reactive.messaging.Message<K>
    • getNack

      public Function<Throwable,CompletionStage<Void>> getNack()
      Specified by:
      getNack in interface org.eclipse.microprofile.reactive.messaging.Message<K>
    • ack

      public CompletionStage<Void> ack()
      Specified by:
      ack in interface org.eclipse.microprofile.reactive.messaging.Message<K>
    • nack

      public CompletionStage<Void> nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)
      Specified by:
      nack in interface org.eclipse.microprofile.reactive.messaging.Message<K>