• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Streaming xlsx file in a servlet

 
dwarakanathan thiru
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have been using a common java file that streams contents in a specific file content type. I have used the code to open / save pdf file contents and small excel file contents.
Now, I am trying to dump a huge xlsx file which takes almost 30 minutes to download on our servers, but in my local server, it takes just half the time.

almost one out of 2 times, it also gets timed out (but no error is thrown on the screen), after 30 minutes or so.
Is the timeout related to session inactivity for 30 minutes because of the download that is happening which avoids the user interaction with the screen?

Which is the better option of the two to solve the timeout issue and to improve the performance?
1) Use a temporary file to store the data and then buffer the contents into the stream (This is the option currently in practice)
2) Write directly into the response output stream

Note: I am using POI to generate the xlsx

I appreciate any timely help in this regard.

Thanks!!
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, using GZIPOutputStream may resolve to a certain extent your time out issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic