Interface Consumer.BatchContext
- All Superinterfaces:
Consumer.Context
- Enclosing interface:
Consumer
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 Consumer.Context.batch(int) on a batch context returns the instance itself.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Consumer.Context context) Add a message context to the batch context.intsize()Get the current number of message contexts in the batch context.Methods inherited from interface Consumer.Context
accept, batch, delayedRetry, delayedRetry, delayedRetry, delayedRetry, discard, discard, requeue, requeue, requeue
-
Method Details
-
add
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
-