Skip to content

Commit 07058bd

Browse files
committed
fix(divide): include request deadlines and pool groups in rule metadata
Describe the existing DTO fields and include them in the shared contract fixtures.
1 parent 7523af8 commit 07058bd

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎docs/divide-configuration-contract.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ The machine-readable catalog is also available through Admin's existing
3333
| `retryBackOffSpec` | `default` | Existing default/fixed/exponential interpretation and fallback |
3434
| `retry` | 3 | Retry count |
3535
| `timeout` | 3000 | Milliseconds |
36+
| `requestTimeout` | absent | Overall HTTPRoute request budget in milliseconds. An absent value uses legacy timeout handling. Zero disables the deadline. |
3637
| `headerMaxSize` | 0 | UTF-8 bytes plus framing allowance; non-positive disables this check |
3738
| `requestMaxSize` | 0 | Body bytes; non-positive disables enforcement |
39+
| `poolGroup` | absent | Optional [upstream connection-pool group](upstream-pool-groups.md). An absent or empty value uses the shared default pool. Named groups are resolved by the gateway. |
3840
| `canary` | absent | Legacy routing; a present configuration uses existing partition validation |
3941
| `sticky` | absent | Existing optional HTTP affinity |
4042

‎shenyu-common/src/main/java/org/apache/shenyu/common/config/contract/DivideRuleContract.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ private static Map<String, ConfigurationContract.Field> fields() {
8080
add(fields, "retryBackOffSpec", STRING, "default", "", false, "default/fixed/exponential; unknown names retain legacy fallback");
8181
add(fields, "retry", INTEGER, "3", "attempt retries", false, "Existing retry count; no new root-field range policy");
8282
add(fields, "timeout", INTEGER, "3000", "milliseconds", false, "Upstream timeout; inherited runtime interpretation is unchanged");
83+
add(fields, "requestTimeout", INTEGER, null, "milliseconds", false, "Overall HTTPRoute request budget; absent uses legacy timeout handling and zero disables the deadline");
8384
add(fields, "headerMaxSize", INTEGER, "0", "bytes", false, "UTF-8 plus framing allowance; non-positive disables checking; legacy form preset is 10240");
8485
add(fields, "requestMaxSize", INTEGER, "0", "bytes", false, "Non-positive disables checking; legacy form preset is 102400");
86+
add(fields, "poolGroup", STRING, null, "", false, "Optional named upstream connection pool; absent or empty uses the shared default pool");
8587
add(fields, "canary", OBJECT, null, "", false, "Absent/null uses legacy routing; a present object must satisfy the existing partition validator");
8688
add(fields, "canary.enabled", BOOLEAN, "false", "", false, "False selects Stable; present values must be JSON booleans");
8789
add(fields, "canary.conditions", ARRAY, null, "", true, "Optional request predicates; explicit null is invalid; an empty list admits all requests");

‎shenyu-common/src/main/resources/META-INF/shenyu/config-contract-fixtures/divide-rule-v1.tsv‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ malformed INVALID false REJECT_RETAIN { $ INVALID_JSON -
2222
array-root INVALID false REJECT_RETAIN [] $ INVALID_TYPE -
2323
bad-root-field INVALID false REJECT_RETAIN {"retry":{}} $ INVALID_JSON -
2424
custom-names VALID true REPLACE {"loadBalance":"contract-custom","retryStrategy":"custom","retryBackOffSpec":"custom"} - - -
25+
named-pool-group VALID true REPLACE {"poolGroup":"bulk"} - - -
26+
request-budget VALID true REPLACE {"requestTimeout":1200} - - -
2527
coercion VALID true REPLACE {"retry":"2","timeout":"9000","requestMaxSize":"1024"} - - -
26-
nullable VALID true REPLACE {"retry":null,"timeout":null,"canary":null,"sticky":null} - - -
28+
nullable VALID true REPLACE {"retry":null,"timeout":null,"requestTimeout":null,"poolGroup":null,"canary":null,"sticky":null} - - -
2729
legacy-ranges VALID true REPLACE {"retry":-1,"timeout":-1,"headerMaxSize":-1,"requestMaxSize":-1} - - -
2830
disabled-canary VALID true REPLACE {"canary":{"stableLabels":{"release":"stable"},"canaryLabels":{"release":"canary"},"enabled":false}} - - -
2931
full-canary VALID true REPLACE {"canary":{"stableLabels":{"release":"stable"},"canaryLabels":{"release":"canary"},"enabled":true,"percentage":100}} - - -

0 commit comments

Comments
 (0)