Hystrix經過一個回調函數保護服務調用。git
@Component public class StoreIntegration { @HystrixCommand(fallbackMethod = "defaultStores") public Object getStores(Map<String, Object> parameters) { //do stuff that might fail } public Object defaultStores(Map<String, Object> parameters) { return /* something useful */; } }
爲了有效監控服務調用狀態,可經過Hystrix Dashboard進行服務狀態監控。github
Hystrix Dashboardspring