Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions google-cloud-pubsublite/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<differenceType>8001</differenceType>
<className>com/google/cloud/pubsublite/ProjectLookupUtils</className>
</difference>
<difference>
<differenceType>6011</differenceType>
<className>com/google/cloud/pubsublite/Constants</className>
<field>MAX_PUBLISH_MESSAGE_BYTES</field>
</difference>
<!-- Blanket ignored files -->
<difference>
<differenceType>4001</differenceType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class Constants {
.build();

public static final long MAX_PUBLISH_BATCH_COUNT = 1_000;
public static final long MAX_PUBLISH_MESSAGE_BYTES = 1_000_000;
public static final long MAX_PUBLISH_BATCH_BYTES = 3_500_000;

private Constants() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.rpc.ApiException;
import com.google.api.gax.rpc.StatusCode.Code;
import com.google.cloud.pubsublite.Constants;
import com.google.cloud.pubsublite.Message;
import com.google.cloud.pubsublite.Offset;
import com.google.cloud.pubsublite.internal.CheckedApiException;
Expand Down Expand Up @@ -203,21 +202,6 @@ private void processBatch(Collection<UnbatchedMessage> batch) throws CheckedApiE
@Override
public ApiFuture<Offset> publish(Message message) {
PubSubMessage proto = message.toProto();
if (proto.getSerializedSize() > Constants.MAX_PUBLISH_MESSAGE_BYTES) {
CheckedApiException error =
new CheckedApiException(
String.format(
"Tried to send message with serialized size %s larger than limit %s on the"
+ " stream.",
proto.getSerializedSize(), Constants.MAX_PUBLISH_MESSAGE_BYTES),
Code.FAILED_PRECONDITION);
try (CloseableMonitor.Hold h = monitor.enter()) {
if (!shutdown) {
onPermanentError(error);
}
}
return ApiFutures.immediateFailedFuture(error);
}
try (CloseableMonitor.Hold h = monitor.enter()) {
ApiService.State currentState = state();
checkState(
Expand Down