File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
common/src/main/java/com/netflix/conductor/common/metadata/workflow
grpc/src/main/proto/model Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1212 */
1313package com .netflix .conductor .common .metadata .workflow ;
1414
15+ import com .netflix .conductor .annotations .protogen .ProtoEnum ;
1516import com .netflix .conductor .annotations .protogen .ProtoField ;
1617import com .netflix .conductor .annotations .protogen .ProtoMessage ;
1718
1819/** Rate limit configuration for workflows */
1920@ ProtoMessage
2021public class RateLimitConfig {
22+
23+ /** Rate limit policy defining how to handle requests exceeding the limit */
24+ @ ProtoEnum
25+ public enum RateLimitPolicy {
26+ /** Queue the request until capacity is available */
27+ QUEUE ,
28+ /** Reject the request immediately */
29+ REJECT
30+ }
31+
2132 /**
2233 * Key that defines the rate limit. Rate limit key is a combination of workflow payload such as
2334 * name, or correlationId etc.
@@ -29,6 +40,10 @@ public class RateLimitConfig {
2940 @ ProtoField (id = 2 )
3041 private int concurrentExecLimit ;
3142
43+ /** Policy to apply when rate limit is exceeded */
44+ @ ProtoField (id = 3 )
45+ private RateLimitPolicy policy = RateLimitPolicy .QUEUE ;
46+
3247 public String getRateLimitKey () {
3348 return rateLimitKey ;
3449 }
@@ -44,4 +59,12 @@ public int getConcurrentExecLimit() {
4459 public void setConcurrentExecLimit (int concurrentExecLimit ) {
4560 this .concurrentExecLimit = concurrentExecLimit ;
4661 }
62+
63+ public RateLimitPolicy getPolicy () {
64+ return policy ;
65+ }
66+
67+ public void setPolicy (RateLimitPolicy policy ) {
68+ this .policy = policy ;
69+ }
4770}
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ option java_outer_classname = "RateLimitConfigPb";
77option go_package = "github.com/netflix/conductor/client/gogrpc/conductor/model" ;
88
99message RateLimitConfig {
10+ enum RateLimitPolicy {
11+ QUEUE = 0 ;
12+ REJECT = 1 ;
13+ }
1014 string rate_limit_key = 1 ;
1115 int32 concurrent_exec_limit = 2 ;
16+ RateLimitConfig.RateLimitPolicy policy = 3 ;
1217}
You can’t perform that action at this time.
0 commit comments