Module bus.limiter

Annotation Interface Downgrade


@Inherited @Documented @Retention(RUNTIME) @Target(METHOD) public @interface Downgrade
Annotation for marking methods that require service request degradation (downgrade). This annotation is used to apply flow control rules that trigger a fallback mechanism when certain conditions are met, such as exceeding a defined threshold.
Since:
Java 17+
Author:
Kimi Liu
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    Specifies the threshold count for the downgrade rule.
    Specifies the flow grade for the downgrade rule.
  • Element Details

    • grade

      FlowGrade grade
      Specifies the flow grade for the downgrade rule. This determines the type of metric used for limiting, e.g., QPS or thread count.
      Returns:
      The FlowGrade for the downgrade rule.
    • count

      int count
      Specifies the threshold count for the downgrade rule. When the resource usage exceeds this count, the downgrade mechanism is triggered.
      Returns:
      The count threshold for the downgrade rule.