I have been trying to implement hystrix fallback to only throw Exception rather than raking a response.
I have been searching up and down for ways to have the fallback method to only throw Exceptions. The whole point of implementing Hystrix here is main to preserve resources and close unnecessary call to another MS that is already down and I need to standardize the response (throw Exception) regardless of what is the originally intended response.
Here is the rough implementation that i'm trying
@HystrixCommand(fallBackMethod="fallback")
public String actualMethod(String input){
code to call another MS
}
private String fallback(String input){
throw RuntimeException("Some specific error message");
}
However, i kept getting fallback failed.
A pointer somewhere would be great. Thanks people