-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix SpEL/placeholder resolution in @RetryableTopic.includeNames
and @RetryableTopic.excludeNames
#4016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SpEL/placeholder resolution in @RetryableTopic.includeNames
and @RetryableTopic.excludeNames
#4016
Conversation
93d8ae7
to
1bdfc4b
Compare
@RetryableTopic.include
and @RetryableTopic.excludeNames
@RetryableTopic.includeNames
and @RetryableTopic.excludeNames
Can you point us, please, where Spring for Apache Kafka documentation says that? |
Certainly — the Javadoc of
While Enabling resolution here improves consistency with |
Thank you for explanation and contribution! will be merged once PR build is green. Looking forward for more! |
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]>
Head branch was pushed to by a user without write access
1bdfc4b
to
66f151f
Compare
The pull request build failed due to a formatting issue — specifically, a I've corrected the formatting accordingly. |
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)
Thank you, @NipponSunrise , for contribution; looking forward for more! |
Previously, the
@RetryableTopic.includeNames
and@RetryableTopic.excludeNames
attributes were not resolved from property placeholders(${...})
or SpEL expressions(#{...})
, despite the documentation stating that all String properties support such resolution.This commit ensures proper resolution via
BeanExpressionResolver
andBeanFactory
, consistent with the behavior of other annotations like@KafkaListener
.