I have an application in Spring Boot RESTful service. My application does not have ideal throughput and causes the clients to get time-out in high volume concurrent requests. In that situation, the machine doesn't reach even 20% of its memory and CPU.
So, I decided to use reactive RESTful. Does making reactive controllers cause any improvement in throughput or is it necessary to make other internal methods like services and repositories reactive as well?
For instance, is it enough writing like following:
@GetMapping
private Flux<Employee> getAllEmployees() {
return employeeRepository.findAllEmployeesReqular();
}
Or is it necessary to write like this, where the internal method is reactive as well?
@GetMapping
private Flux<Employee> getAllEmployees() {
Flux<Employee> employees =employeeRepository.findAllEmployeesReactive();
return employees;
}