# Overview

The interface circuit breaker function is used to configure circuit breaker rules at the service and path levels. The circuit breaker policy supports abnormal proportion and number of exceptions. The recovery strategy supports attempted recovery, gradual recovery, and immediate recovery, and supports customized response messages after triggering circuit breaker. The interface fusing function is introduced below.

# Interface circuit breaker list

Menu location: Fuse Management > Interface Fuse. Click the menu to enter the interface fuse list page, as shown in the figure.

manager_degrade_rule_path_query

# Add interface rules

Click the Add button to pop up the new window, as shown in the figure.

manager_degrade_rule_path_add_1

manager_degrade_rule_path_add_2

Front-end service name: Select the service name to be blown from the drop-down list, required;

Front-end API path: If the interface URL is http://gateway IP:port/proxy/user-service/user/list, enter /user/list. If the path is not configured, it will be fused according to the service;

Circuit breaker strategy: Optional Abnormal ratio|Number of exceptions, required;

Proportion threshold: This item appears when the circuit breaker policy selects Abnormal proportion. The abnormal request proportion threshold exceeds this value and triggers circuit breaker. The default value is 0.5, required;

Number of exceptions: This item appears when the circuit breaker policy selects the number of exceptions. The number of abnormal requests exceeds this value and triggers circuit breaker. The default value is 50, which is required;

manager_degrade_rule_path_add_3

Minimum number of requests: When the number of requests is less than this value, the circuit breaker will not be interrupted even if the abnormal request exceeds the threshold. The default value is 100, which is required;

Circuit breaker duration: The length of time the request is circuit breaker after triggering the circuit breaker. The default value is 10, required;

Statistical duration: the statistical duration of the circuit breaker, the default value is 10, required;

Recovery strategy: Optional Try recovery|Gradual recovery|Recover immediately, required;

  • Attempt to recover: After the circuit breaker ends, a request is allowed to enter. When the request is successful, the service is restored. If the request fails, it will immediately enter the next circuit breaker duration;

  • Gradual recovery: After the circuit breaker is over, requests are gradually released in proportion to the recovery time. For example, if the recovery time is configured to be 5 seconds, 20% of the requests will be released in the first second, 40% of the requests will be released in the second second,..., Chapter 100% of requests will be passed in 5 seconds;

  • Immediate recovery: services will be restored immediately after the circuit breaker ends and all requests will be allowed;

Recovery duration: This item appears when Recovery Strategy selects Gradual Recovery. The recovery duration after the circuit breaker ends. The default value is 5 and is required;

Circuit breaker response ContentType: Customized circuit breaker response content type. If not configured, the circuit breaker response ContentType in the default rules will be used;

Circuit breaker response message: Customized circuit breaker response message. If not configured, the circuit breaker response message in the default rules will be used.

# Edit interface rules

Click the Edit button to pop up the editing window, as shown in the figure.

manager_degrade_rule_path_edit_1

manager_degrade_rule_path_edit_2

# Delete interface rules

Click the Delete button to pop up the deletion confirmation window, as shown in the figure.

manager_degrade_rule_path_delete_1

manager_degrade_rule_path_delete_2