Interface DocumentBatch<T>

Type Parameters:
T - document type
All Superinterfaces:
Iterable<T>

public interface DocumentBatch<T> extends Iterable<T>
A batch of documents, returned by DocumentSource.poll(java.time.Duration)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Acknowledge that this batch is handled.
     
    default Iterator<T>
     
    void
    Reject document batch The underlying DocumentSource should roll back this batch if the source has transactional properties.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getDocuments

      Collection<T> getDocuments()
      Returns:
      documents in batch
    • acknowledge

      void acknowledge()
      Acknowledge that this batch is handled. The underlying DocumentSource should commit this batch if the source has transactional properties.
    • reject

      void reject()
      Reject document batch The underlying DocumentSource should roll back this batch if the source has transactional properties. This means that the entire batch should be redelivered later (depending on implementation).
    • iterator

      default Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>