I have an abstract class
public abstract class A {
public String makeSomething(String ingredients){
throw new RuntimeException("Can't Make anything");
}
}
This class is realised in another class B(Spring Service) which uses makeSomething in many of its own methods by passing Ingredients. Each method in class B is annotated with HystrixCommand and a fallback has been defined for it. Here is what it looks like
@Service
public class B extends A {
@HystrixCommand(fallbackMethod = "doNothing")
public void makeTea(String ingredients){
makeSomething(ingredients);
}
public void doNothing(String ingredients){
System.out.println("Doing Nothing");
}
}
Now when makeTea from class B is invoked, it inturn calls makeSomething from class A which then throws exception. This should be wrapped as HystrixRuntimeException and then fallback should be invoked. But I am seeing RunTimeException("Can't Make anything").