Skip to content

Commit

Permalink
fix: added a maximum metadata size when creating the subscriber (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicatka committed Mar 22, 2022
1 parent 2d5c010 commit 3a8c83b
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -93,6 +93,9 @@ public class Subscriber extends AbstractApiService implements SubscriberInterfac
private static final int MAX_INBOUND_MESSAGE_SIZE =
20 * 1024 * 1024; // 20MB API maximum message size.

private static final int MAX_INBOUND_METADATA_SIZE =
4 * 1024 * 1024; // 4MB API maximum metadata size

@InternalApi static final Duration DEFAULT_MAX_ACK_EXTENSION_PERIOD = Duration.ofMinutes(60);

@InternalApi
Expand Down Expand Up @@ -480,6 +483,7 @@ public static final class Builder {
private TransportChannelProvider channelProvider =
SubscriptionAdminSettings.defaultGrpcTransportProviderBuilder()
.setMaxInboundMessageSize(MAX_INBOUND_MESSAGE_SIZE)
.setMaxInboundMetadataSize(MAX_INBOUND_METADATA_SIZE)
.setKeepAliveTime(Duration.ofMinutes(5))
.build();
private HeaderProvider headerProvider = new NoHeaderProvider();
Expand Down

0 comments on commit 3a8c83b

Please sign in to comment.