TopicReaderSync.receive_batch now takes max_messages and max_bytes into account.
Other information
Decisions made:
Enforce at least one message and at least a single byte on a batch.
Since a batch could theoretically be empty, don't use _commit_get_partition_session, and rather copy _partition_session from the batch to a new (sliced) batch.
Make no slice in case if neither max_messages, nor max_bytes were provided.
Allow a client to control the amount of data it receives, when reading a batch through
TopicReaderSync
.Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
TopicReaderSync.receive_batch
ignoresmax_messages
andmax_bytes
parameters, which means a client has no control over the amount of received data.Issue Number: 365
What is the new behavior?
TopicReaderSync.receive_batch
now takesmax_messages
andmax_bytes
into account.Other information
Decisions made:
_commit_get_partition_session
, and rather copy_partition_session
from the batch to a new (sliced) batch.max_messages
, normax_bytes
were provided.