Posts

Showing posts with the label httprequest

Read a huge result set from HttpServiceClient and display them in chunks

Read a huge result set from HttpServiceClient and display them in chunks Im writting a Java APP wich reads a huge chunk of data : try { //Build the URL getMethod = new GetMethod(url); SimpleHttpResponseParser parser = new SimpleHttpResponseParser(); httpServiceClient.getRequest(...); //This takes about 10 minutes List<ApiMessage> messages = objectMapper.readValue(parser.getHttpResponse()); //Convert the JSON Response into actual Java Object for (ApiMessage m : messages) { convertedMessages.add(ApiMessageMapper.map(m)); //Add each message to a more suidable data set to be painted later } //Return the data and such ... } This request takes way to long to handle it. I dont want the user to wait over 10 minutes to see the results. Is there a way to paint by result sets of 50 or so and keep downloading the remaining data in the background? ...