Interface Consumer.BatchContext

All Superinterfaces:
Consumer.Context
Enclosing interface:
Consumer

public static interface Consumer.BatchContext extends Consumer.Context
Context to accumulate message contexts and settle them at once.

A Consumer.BatchContext is also a Consumer.Context: the same methods are available to settle the messages.

Only "simple" (not batch) message contexts can be added to a batch context. Calling

invalid reference
Context#batch()
on a batch context returns the instance itself.
See Also:
  • Method Details

    • add

      void add(Consumer.Context context)
      Add a message context to the batch context.
      Parameters:
      context - the message context to add
    • size

      int size()
      Get the current number of message contexts in the batch context.
      Returns:
      current number of message contexts in the batch