问题
I'm a big fan of the Open Source project of Netflix. They made some really cool stuff.
I have set up a Zuul and that is working fine. Created all kind of filters and those are dynamically loaded and run.
What I now try to do is use Hystrix inside a filter. What I see is that if everything when fine it all works. But when there is a exception inside the run() method Zuul is catching it instead of Hystrix. So the getFallback() is never called.
I shared my code Github.
Somebody has any idea how Hystrix can catch the exception instead of Zuul?
回答1:
I think the issue is actually with how you are executing your hystrix command. Try calling execute() instead of run(). I suspect that what's happening is run() is simply throwing the exception whereas execute() will catch it and call getFallback().
来源:https://stackoverflow.com/questions/22934152/combining-netflix-zuul-with-netflix-hystrix