Performance: Service-to-service communication
MEDIUM IMPACT
This affects the speed and responsiveness of backend interactions that impact frontend load times and user experience.
private final WebClient webClient = WebClient.create(); Mono<String> response = webClient.get().uri("http://service/api/data").retrieve().bodyToMono(String.class);
RestTemplate restTemplate = new RestTemplate(); String response = restTemplate.getForObject("http://service/api/data", String.class);
| Pattern | Thread Usage | Latency Impact | Network Cost | Verdict |
|---|---|---|---|---|
| Synchronous RestTemplate per call | Blocks thread | High latency | Medium | [X] Bad |
| Non-blocking WebClient with pooling | Non-blocking | Low latency | Medium | [OK] Good |
| Sequential service calls | Blocks threads sequentially | High cumulative latency | Medium | [X] Bad |
| Parallel reactive calls | Non-blocking | Low cumulative latency | Medium | [OK] Good |
| Large payloads | N/A | High latency | High | [X] Bad |
| Minimal DTOs with compression | N/A | Low latency | Low | [OK] Good |