I have an object with some attributes and a very large list of another object. it looks like this:
public class Company {
private String attr1;
private String attr2;
private long attr3;
private List<Employee> employees; // very large
...
}
public class Employee {
private long id;
private String name;
.....
}
I want to send an object Company (with a list of over 500.000 employees) in a Rest request from a microservice to another (to be saved in its database) using Spring's WebClient. What is the most optimal way to do that without risking a server crash?
Thank you