Combining Netflix Zuul with Netflix Hystrix

被刻印的时光 ゝ 提交于 2019-12-06 06:44:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!