diff --git a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java index 55434aa17775..2b1fa858010a 100644 --- a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java +++ b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java @@ -203,7 +203,7 @@ public ApiFuture 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()) { @@ -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);