Commit d4925d6
authored
GH-4016: Fix
Fixes: #4016
Previously, the `includeNames` and `excludeNames` attributes of
`@RetryableTopic` were not processed through the configured
`BeanExpressionResolver` and `BeanExpressionContext`.
This change ensures proper resolution from property placeholders
`(${...})` and SpEL expressions `(#{...})`, consistent with the
documentation and behavior of similar annotations like `@KafkaListener`.
Signed-off-by: Dimitri Tugo <[email protected]>
[[email protected]: Improve comint message]
The Javadoc of the `@RetryableTopic` includes the statement:
> All String properties can be resolved from property placeholders `${...}` or SpEL expressions `#{...}`.
While `includeNames` and `excludeNames` are technically `String[]` rather than `String`, it’s a reasonable and common expectation that this applies to all string-valued attributes — including arrays.
This interpretation is also consistent with how similar annotations behave, such as `@KafkaListener`, where array properties like topics support both property placeholders and SpEL expressions on a per-element basis.
Enabling resolution here improves consistency with `@KafkaListener`, reduces potential surprises, and allows for cleaner externalization of retryable or non-retryable exception lists.
**Auto-cherry-pick to `3.3.x`**
Signed-off-by: Artem Bilan <[email protected]>@RetryableTopic includeNames/excludeNames for SpEL1 parent 08985a3 commit d4925d6
File tree
1 file changed
+29
-2
lines changed- spring-kafka/src/main/java/org/springframework/kafka/annotation
1 file changed
+29
-2
lines changedLines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 | | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
426 | 453 | | |
0 commit comments