gRPC message exceeds

You need to use maxInboundMessageSize(int bytes) like this:

ManagedChannel channel = ManagedChannelBuilder.forAddress(HOST, PORT)
                             .maxInboundMessageSize(1024*1024*1024)
                             .usePlaintext()
                             .build();
    DgraphStub stub = DgraphGrpc.newStub(channel);

The above code sample increases the limit to 1GiB, from default 4MiB.