0

I am trying to build a Spring REST Read operation using spring boot. Typically for all read only operations preference should be HTTP GET only.. (at least as far as I know)

Scenario: Client will be sending a list of UUID(assume it as employeeID) values to read employee data. Here Client has a provision to select a bunch of employees and read the data.

Once request is received I need to iterate through those IDs and invoke an existing third party service which will give me the employee data. Once all UUIDs are processed a report will be generated for all those selected employees.

List of items I would like to hear from you all is..

  1. How to achieve GET operation here when incoming IDs are more than HTTP GET URI limit. Because if the IDs are 100 then the URI is going to reach the limit.
  2. Please request to not suggest for HTTP POST because of few limitations in the requirement.
  3. Any references for handling this scenario asynchronously is much appreciated.
  4. If you suggest to store the IDs first into a table and process them later.. Sorry this is not something what I am looking for. Because client need this data in less than 10 seconds.. (approx)

3 Answers3

0

Ok you are very restricted but I can see that there are two ways to face it, group them or send them by parts then my suggestions are:

  1. I read number 4 but you can improve your requests and time execution sending async requests, then you can send a segment with a ID and total of UUID's to get all information in a short time in server, then you could process it.

  2. Make segments of UUID's to identify them by groups and not individually, then your UUID's will be few.

  3. I don't know if you can get a "selected event" with a check box to send a request for every event, when user sends "generate report event" then you has all data in server.

z1lV3r
  • 429
  • 5
  • 10
0

How to achieve GET operation here when incoming IDs are more than HTTP GET URI limit. Because if the IDs are 100 then the URI is going to reach the limit

Instead of sending these IDs in URI, add these IDs in request body send with GET request.

HTTP GET with request body

Hemant
  • 1,295
  • 2
  • 7
  • 19
0

You can totally send the UUID's as a request body with GET call. It works just fine.

Pradyskumar
  • 144
  • 1
  • 9