Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public ApiFuture<String> publish(PubsubMessage message) {
final OutstandingPublish outstandingPublish = new OutstandingPublish(publishResult, message);
messagesBatchLock.lock();
try {
// Check if the next message makes the batch exceed the current batch byte size.
// Check if the next message makes the current batch exceed the max batch byte size.
if (!messagesBatch.isEmpty()
&& hasBatchingBytes()
&& batchedBytes + messageSize >= getMaxBatchBytes()) {
Expand All @@ -212,8 +212,8 @@ && hasBatchingBytes()
batchedBytes = 0;
}

// Border case if the message to send is greater equals to the max batch size then can't be
// included in the current batch and instead sent immediately.
// Border case if the message to send is greater or equals to the max batch size then can't
// be included in the current batch and instead sent immediately.
if (!hasBatchingBytes() || messageSize < getMaxBatchBytes()) {
batchedBytes += messageSize;
messagesBatch.add(outstandingPublish);
Expand Down