Service downgrade Hystrix

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.
Insert picture description here

Insert picture description here
Create a fallbackFactory processing factory
Insert picture description here
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:
Insert picture description here
Then start the access normally.
Insert picture description here
Close the server.
Insert picture description here
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.

Guess you like

Origin blog.csdn.net/old_wzhou/article/details/114115467