Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-874

Unreasonably slow upload of large files in the client framework.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.0-RC-1
    • 2.3.6.Final, 3.0-beta-5
    • None

      Upload of a several MB file to a PUT service results in a very slow creation of a temporary file.

      Produced by code below:

      import java.io.FileInputStream;
      import java.io.FileNotFoundException;
      import java.io.InputStream;
      
      import javax.ws.rs.Consumes;
      import javax.ws.rs.PUT;
      import javax.ws.rs.Path;
      
      import org.jboss.resteasy.client.ProxyFactory;
      import org.junit.Test;
      
      public class DummyTest {
      	@Path("/dummy")
      	interface DummyService {
      		@PUT
      		@Consumes("*/*")
      		String process( InputStream data );		
      	}
      	
      	@Test
      	public void test() throws FileNotFoundException {
      		DummyService service = ProxyFactory.create( DummyService.class, "http://nonexistent.domain/rest/" );
      		
      		service.process( new FileInputStream( "<path to a large file>" ) );
      	}
      }
      

      Result is 100% CPU load for several minutes while building a temporary file, followed by an UnknownHostException, as expected.

      Tested on Windows XP sp 3 with RESTEasy 2.3.5 and JRE 1.6.0_27.

            patriot1burke@gmail.com Bill Burke (Inactive)
            rruusu Reino Ruusu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: