Cluster flow control is useful in plenty of scenarios. For example:
In FlowRule
:
private boolean clusterMode; // whether to enable the cluster mode
private ClusterFlowConfig clusterConfig; // items about the cluster flow control
In ClusterFlowConfig
:
// Required and unique. Usually assigned by the dashboard
private Long flowId;
// Threshold type. 0 for average threshold (per instance), 1 for global threshold.
private int thresholdType = ClusterRuleConstant.FLOW_THRESHOLD_AVG_LOCAL;
// Whether to fallback to local flow control if the transport between token client and server failed
private boolean fallbackToLocalWhenFail = true;