Open bentein opened 6 years ago
did you find any solution ? , it seems i have the same problem
Did you try to create an internal private method, and add the annotation to that method instead? That was one way to solve it. Another is to simply create a wrapper-class for the list, and use that as the return type instead.
@bentein You need to have the same parameters with your method for the fallback method. This is what the netflix documentation says and also in stacktrace it gives as a hint "Hint: Different size of types variables." It seems a bit strange relation of return type and parameters.
Your method is public List getData(String id, LocalDate startDate, LocalDate endDate) Your fallback is public List getDataFallback(String id, LocalDate startDate, LocalDate endDate, Throwable t)
Fallback has additional parameter. You need to decide that point.
I have the following Hystrix fallback
Which is attached to the following method
The Data object is a simple POJO, using Lombok to generate methods, and looks like this
When the annotated method is run directly from my Spring controller, I get the following error:
If I wrap the list in another object, and refactor the methods accordingly, the exact same configuration works as expected.
When calling the annotated method inside another method, example below, instead of calling it directly from the controller, the exact same configuration works as expected.