/** * Returns a new stub that limits the maximum acceptable message size from a remote peer. * * <p>If unset, the {@link ManagedChannelBuilder#maxInboundMessageSize(int)} limit is used. * * @since 1.1.0 */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") public final S withMaxInboundMessageSize(int maxSize) { return build(channel, callOptions.withMaxInboundMessageSize(maxSize)); }
Integer existingLimit = callOptions.getMaxInboundMessageSize(); if (existingLimit != null) { callOptions = callOptions.withMaxInboundMessageSize( Math.min(existingLimit, info.maxInboundMessageSize)); } else { callOptions = callOptions.withMaxInboundMessageSize(info.maxInboundMessageSize);
callOptions = callOptions.withMaxInboundMessageSize(traceProperties.getMaxInboundSize());