-
Notifications
You must be signed in to change notification settings - Fork 223
Description
Expected Behavior
When using the dapr.io/max-body-size: 16Mi
annotation on a Kubernetes deployment, the Dapr Java SDK should be able to handle gRPC messages up to the configured size limit (16MB in this case) when downloading files through bindings.
Actual Behavior
Despite setting dapr.io/max-body-size: 16Mi
in the pod annotations and confirming it's applied to the sidecar (--max-body-size 16Mi
in daprd container args), the Java SDK fails with:
RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 10485765
The error occurs when trying to download a 10MB file from Google Cloud Storage using the GCS binding through the Dapr Java SDK. The default gRPC message size limit of 4MB is being enforced by the client, ignoring the sidecar's configured 16MB limit.
Steps to Reproduce the Problem
-
Create a Kubernetes deployment with Dapr sidecar enabled
-
Set
dapr.io/max-body-size
annotation on Kubernetes deployment with a value larger than 4MB -
Configure GCS Binding Compnent
-
Use Java SDK to download file >4MB via GCS binding:
DaprClient client = new DaprClientBuilder().build();
Map<String, String> meta = new HashMap<>();
meta.put("key", "large-file-10mb.bin");
InvokeBindingRequest req = new InvokeBindingRequest("gcs-binding", "get");
req.setMetadata(meta);
var response = client.invokeBinding(req).block(); // Fails here
- The operation fails with RESOURCE_EXHAUSTED error
Possible Root Cause
The issue is in the Java SDK's NetworkUtils.java where gRPC channel builder is missing these parameters:
builder.maxInboundMessageSize()
builder.maxInboundMetadataSize()
Release Note
RELEASE NOTE: