Feign combined with Hystrix service downgrade
What is service degradation?
When there are multiple servers at the same time, the access volume of server A increases sharply. At this time, the access volume of server B and C is not too much. We can choose to close server C to give server A more resources to process requests. Open the C server.
Take the Feign client as an example
. Specify a custom processing factory by configuring the fallbackFactory attribute of the @FeignClient annotation. It is worth mentioning that there are two options. The first is the specified class and the second is the factory.
Create a fallbackFactory processing factory
Modify the configuration file. In the new version of Springcloud, Feign has turned off the support for Hystrix by default. It needs to be configured in application.yml:
Then start the access normally.
Close the server.
Summary:
Service fuse : a certain microservice on the server Overtime or abnormal, causing blown ~ similar to a fuse
Service degradation: The client considers the overall website load. When a service is broken or closed, the service will no longer be called. We can prepare a Fallback callback to return a default value (default value) when the client is disconnected.