Gan
Gan

Reputation: 644

How server will handle multiple user file download request for temporary file generated at server?

I have following scenario: number of user can request download is 100 I am creating excel file in server by name "temp.xlsx" containing user specific information and then sending file in response.

what will happen if 10 user request file ?

  1. server will process request synchronously one after other ? or

  2. server will process request paralleled

    but in 2nd case what will happen as server will try to create and read file "temp.xlsx" for all user request, please note file is expected to have user specific information not common for all user.

Above code is already in DEV environment ,I just want to understand how it will behave in PROD for multiple user, Thanks in Advance.

Technologies: Java REST services, Apache POI, Server Karaf container

Upvotes: 0

Views: 259

Answers (1)

Alessandro Da Rugna
Alessandro Da Rugna

Reputation: 4695

Requests will most probably be processed in parallel. This depends on your container configuration. (See for example this question about Jetty thread pool size in Karaf)

You should

  1. create file with unique name like temp-$username-$timestamp.xlsx
  2. send the file to the user with desired name in the HTTP header

Upvotes: 2

Related Questions