Fix maximum inbound message size

This commit is contained in:
Andrea Cavalli 2024-09-20 15:23:09 +02:00
parent 3594cb6b76
commit 974d8b774a

View File

@ -45,6 +45,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import org.rocksdb.util.SizeUnit;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -77,6 +78,7 @@ public class GrpcServer extends Server {
.directExecutor() .directExecutor()
.channelType(channelType) .channelType(channelType)
.withChildOption(ChannelOption.SO_KEEPALIVE, false) .withChildOption(ChannelOption.SO_KEEPALIVE, false)
.maxInboundMessageSize(Math.toIntExact(128 * SizeUnit.MB))
.addService(grpc) .addService(grpc)
.build(); .build();
server.start(); server.start();