Status: Closed (View Workflow)
Affects Version/s: None
Fix Version/s: 11.5.0
Sprint:EPAM BatchLoader Sprint 17, EPAM BatchLoader Sprint 18
Considering a latest test results about performance for the mod-source-record-manager, we need to improve an algorithm for sending Instances to the mod-inventory. In current implementation We are doing send Instances in sequential manner (one Instance POST request per each parsed record) which obviously takes a lot of time.
I propose to post only one request with collection of Instances - so called "batch" POST request.
For this purpose we need to have an endpoint in the mod-inventory that is able to receive Instances and save it in the mod-inventory-storage. This is just as an existing method works, which receives only one Instance.
Designed endpoint receives collection of Instances (that easily could be mapped to JsonArray)
Boby: collection of Instances and total number of Instances
Returns: collection of successfully created Instances, error messages for failure Instances, total number of created Instances:
- If all received Instances are successfully saved - returns 201 response with saved instances, "errorMessages" array is empty.
- If save for one or more Instances has failed - returns 500 response with "errorMessages" array, explaining a reason of why Instances were processed with failures (one error message per one Instance). If there are Instances that were successfully saved (among wrong Instances) - response contains successfully saved Instances ("instances" section).