I'm trying to combine 2 or more services and I want to check statuses of them and return custom response. For example one of them returns 200 and the other returns 500, 404, 400 and etc. In this case I want to return empty list. The example below is only valid when all services returning 200
@RestController
@RequiredArgsConstructor
public class Demo3Controller {
private final Demo1Client demo1Client;
private final Demo2Client demo2Client;
@GetMapping("/demo3")
public String get(){
return demo1Client.getDemo1() + "&&" + demo2Client.getDemo2();
}
}