Commit a94978a
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.
Signed-off-by: Artem Bilan <[email protected]>
(cherry picked from commit d4925d6)@RetryableTopic includeNames/excludeNames for SpEL1 parent fcdef5f commit a94978a
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 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
| 143 | + | |
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
| |||
422 | 428 | | |
423 | 429 | | |
424 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
425 | 452 | | |
0 commit comments