Class MessageBatch
java.lang.Object
io.fluxzero.common.api.tracking.MessageBatch
Represents a batch of messages retrieved from the message store for a specific segment range.
A message batch contains a list of SerializedMessage instances and metadata such as the last known index and
the Position of the consumer when this batch was read.
The segment and position fields are especially relevant when the tracker operates with
ignoreSegment=true, meaning segment filtering is handled on the client side. In such cases, the Runtime
returns all potentially matching messages, and the client uses the Position and segment range to
determine which messages are truly relevant for processing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCompact summary of aMessageBatch, used for logging and performance tracking. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetBytes()Calculates the total number of bytes in the data across all messages within the batch.intgetSize()Returns the number of messages contained in this batch.booleanisEmpty()Indicates whether this message batch is empty.toMetric()Converts this batch into a compact, serializable representation for monitoring purposes.toString()
-
Constructor Details
-
MessageBatch
public MessageBatch()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Indicates whether this message batch is empty. -
getSize
public int getSize()Returns the number of messages contained in this batch. -
getBytes
public long getBytes()Calculates the total number of bytes in the data across all messages within the batch. -
toString
-
toMetric
Converts this batch into a compact, serializable representation for monitoring purposes.- Returns:
- a
MessageBatch.Metricrepresenting key metadata about this batch
-