[英]gRPC message exceeds maximum size 4194304: 5145024
在 grpc 客戶端上調用服務器中的 rpc 方法后出現此錯誤。 我正在使用 grpc-spring-boot-starter (java)。 請告訴我如何增加響應大小。
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 9089).usePlaintext().maxInboundMessageSize(Integer.MAX_VALUE).build();
productsBlockingStub prodStub = productsGrpc.newBlockingStub(channel);
您可以在此處參考 grpc 項目。 只需添加修改 maxInboundMessageSize
@GrpcClient("greeting-service")
private GreetingServiceGrpc.GreetingServiceBlockingStub greetingServiceBlockingStub;
greetingServiceBlockingStub = greetingServiceBlockingStub.withMaxInboundMessageSize(Integer.MAX_VALUE);
greetingServiceBlockingStub = greetingServiceBlockingStub.withMaxOutboundMessageSize(Integer.MAX_VALUE);
或者在道具中添加這個。
grpc.client.greeting-service.max-inbound-message-size=9155241000
grpc.client.greeting-service.package-max-inbound-message-size=9155241000
grpc.client.greeting-service.server.max-inbound-message-size=9155241000
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.