0

I currently have a big issue that I'm not able to solve.

I have a REST controller which allows to upload and unzip a large file (700 MB compressed, 11 GB uncompressed), but it takes so much time that it systematically loses the connection with the GUI.

To fix that, I have tried to use Spring Batch to make the unzip step asynchronous. However now it loses the connection with the db.

Is there is a way to do make the REST controller handle the large files without losing connection to either DB and GUI?

Thanks a lot in advance.

Fullslack
  • 290
  • 1
  • 2
  • 11
M.ferlay
  • 47
  • 1
  • 5
  • 1
    It's not clear how your components are connected, or even to guess which ones are involved. Gui? DB? Who does what, and when? – daniu Jul 22 '20 at 06:21
  • Why do you even need a connection to DB to unzip a file? – Amongalen Jul 22 '20 at 06:22
  • For the GUI connection: why not use a websocket to notify the client when the unzip has succeeded? That way you have time to queue and process several files without having the client wait for tens of seconds or even minutes. – Fullslack Jul 22 '20 at 06:27
  • daniu, Amongalen, I have a Gui which send a zipped file by chunck to a rest controller which must unzip this file and save the path of the new unzipped file in a db. So I have splitted this process in two steps. First unzip, secondly save file path. The problem is spring batch must store the status of those steps in db to know if they are completed or not. The issue is due to the time taken by the first step. Fullslack.dev Do not know if it s possible with Angular. The goal in our process is to block the progression of the user till this step is not done. I will check in this direction – M.ferlay Jul 22 '20 at 07:47
  • You can use [websockets in Angular](https://javascript-conference.com/blog/real-time-in-angular-a-journey-into-websocket-and-rxjs/) (quick Google search, no idea of how good this site is). Depending on your use-case you can also use them to block and unblock the interface (if not native Angular, use JavaScript). At least the websockets are a means to keep the front-end connected with the back-end, seeing as I can understand the delay's are easily breaking this connection. – Fullslack Jul 22 '20 at 08:08

0 Answers0