/** * Returns a new stub that limits the maximum acceptable message size to send a remote peer. * * @since 1.1.0 */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") public final S withMaxOutboundMessageSize(int maxSize) { return build(channel, callOptions.withMaxOutboundMessageSize(maxSize)); } }
Integer existingLimit = callOptions.getMaxOutboundMessageSize(); if (existingLimit != null) { callOptions = callOptions.withMaxOutboundMessageSize( Math.min(existingLimit, info.maxOutboundMessageSize)); } else { callOptions = callOptions.withMaxOutboundMessageSize(info.maxOutboundMessageSize);
callOptions = callOptions.withMaxOutboundMessageSize(traceProperties.getMaxOutboundSize());